[R-pkg-devel] R graphics 'text' package 'adj' parameter order wrong incorrect reversed?

Simon Dedman @imondedm@n @ending from gm@il@com
Wed Sep 19 01:11:14 CEST 2018


Original stack overflow post here:
https://stackoverflow.com/questions/52194719/r-graphic-text-package-adj-parameter-order-wrong-incorrect-reversed

Hopefully this is now the appropriate place to post this as the above post
got a single comment of agreement.

Content:

I believe R core package graphics text function's adj parameter is
incorrectly described in the manual
<https://stat.ethz.ch/R-manual/R-devel/library/graphics/html/text.html> and
would be grateful if someone could confirm this before I submit a bug report
<https://www.r-project.org/bugs.html>.

adj text:

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.

Reproducible example:

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))

Thanks.

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list