dez93_2000
dez93_2000

Reputation: 1875

R graphic 'text' package 'adj' parameter order wrong incorrect reversed?

I believe R core package graphics text function's adj parameter is incorrectly described in the manual and would be grateful if someone could confirm this before I submit a bug report.

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 (left & bottom) is top & right; 1,1 (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.

Upvotes: 1

Views: 487

Answers (1)

user4840021
user4840021

Reputation: 21

For generations of typesetters, left justification has been aligning the type with the right edge of the frame so that the lines are aligned on the left edge of the printed page. History often gets us turned around.

Upvotes: 2

Related Questions