Skip to content

Commit

Permalink
Merge branch 'linestack-order'
Browse files Browse the repository at this point in the history
  • Loading branch information
jarioksa committed Nov 24, 2024
2 parents eb8b669 + a990236 commit 29aa6b7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions R/linestack.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,22 @@
}
}
segments(at, x[1], at, x[n])
## plot text in the original order for correct matching of vectors
## of graphical parameters (...).
o <- order(ord)
if (side == "right") {
text(at + hoff, pos, labels, pos = 4, cex = cex, offset = 0.2,
text(at + hoff, pos[o], labels[o], pos = 4, cex = cex, offset = 0.2,
...)
segments(at, x, at + hoff, pos)
}
else if (side == "left") {
text(at - hoff, pos, labels, pos = 2, cex = cex, offset = 0.2,
text(at - hoff, pos[o], labels[o], pos = 2, cex = cex, offset = 0.2,
...)
segments(at, x, at - hoff, pos)
}
if (axis)
axis(if (side == "right")
2
else 4, pos = at, las = 2)
invisible(pos[order(ord)])
invisible(pos[o])
}

0 comments on commit 29aa6b7

Please sign in to comment.