From murdoch at stats.uwo.ca  Tue Jul 22 14:54:15 2008
From: murdoch at stats.uwo.ca (Duncan Murdoch)
Date: Tue, 22 Jul 2008 08:54:15 -0400
Subject: [Rd] Is text(..., adj) upside down? (Or am I?)
In-Reply-To: <s885d468.016@tedmail.lgc.co.uk>
References: <s885d468.016@tedmail.lgc.co.uk>
Message-ID: <4885D877.1070103@stats.uwo.ca>

On 7/22/2008 7:36 AM, S Ellison wrote:
> ?text says
>     "'adj' allows _adj_ustment of the text with respect to '(x,y)'.
>      Values of 0, 0.5, and 1 specify left/bottom, middle and
> right/top,
>      respectively."
> 
> But it looks like 0, 1 specify top, bottom respectively in the y
> direction.
> 
> plot(1:4)
> text(2,2, "adj=c(0,0)", adj=c(0,0))
> text(2,2, "adj=c(0,1)", adj=c(0,1), col=2) #the red one's below the
> black one...
> 
> #x-adj is OK
> text(3,3, "adj=c(0,0)", adj=c(0,0))
> text(3,3, "adj=c(1,0)", adj=c(1,0), col=2)
> 
> [I am using r 2.7.1 in windows; adj behaviour is consistent in 2.6.0ff
> and for expressions as well as text]
> 
> Perhaps a two-word correction to ?text ?

I think it is behaving as I'd expect:  the y adjustment of 0 says that 
the bottom of the text aligns with the specified point, while the y 
adjustment of 1 says that the top of the text aligns there.  This is 
consistent with the description for x:  0 says the left end aligns, 1 
says the right end aligns.

The text may be a little terse, but it is consistent.

Duncan Murdoch



[Rd] Is text(..., adj) upside down? (Or am I?)
Duncan Murdoch