[R-pkg-devel] R graphics 'text' package 'adj' parameter order wrong incorrect reversed?
@imondedm@n @ending from gm@il@com
Wed Sep 19 01:11:14 CEST 2018
Original stack overflow post here:
Hopefully this is now the appropriate place to post this as the above post
got a single comment of agreement.
I believe R core package graphics text function's adj parameter is
incorrectly described in the manual
would be grateful if someone could confirm this before I submit a bug report
adj allows adjustment of the text with respect to (x, y). Values of 0, 0.5,
and 1 specify left/bottom, middle and right/top alignment, respectively.
Since text controls these labels and not the points which have already been
plotted, I can't see how "with respect to x,y" can mean anything other than
"in this direction relative to their points".
However the order is reversed: 0,0 (supposedly left & bottom) is top &
right; 1,1 (supposedly right & top) is left and bottom.
tens = 1:10
plot(tens, tens, xlab = "adj 0,0 left/bottom")
text(tens, tens, labels = letters[tens], adj = c(0,0))
plot(tens, tens, xlab = "adj 0.5,0.5 middle")
text(tens, tens, labels = letters[tens], adj = c(0.5,0.5))
plot(tens, tens, xlab = "adj 1,1 right/top")
text(tens, tens, labels = letters[tens], adj = c(1,1))
[[alternative HTML version deleted]]
More information about the R-package-devel