[R] Specifying relative position of text in a plot

Greg Snow Greg.Snow at imail.org
Wed Mar 12 18:43:25 CET 2008


I tested the main set of examples from cnvrt.coords using the new
grconvert functions and they worked perfectly.  I have already noted in
the help page for cnvrt.coords (for the next version coming out soon)
that people should start using grconvertX and grconvertY when they
become available.

Are there any more of the utilities in TeachingDemos that will be need
to be depricated with the release of version 2.7? (I read through the
current NEWS file, but are there any more planned?).

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
(801) 408-8111
 
 

> -----Original Message-----
> From: r-help-bounces at r-project.org 
> [mailto:r-help-bounces at r-project.org] On Behalf Of Prof Brian Ripley
> Sent: Wednesday, March 12, 2008 9:13 AM
> To: Tom La Bone
> Cc: r-help at r-project.org
> Subject: Re: [R] Specifying relative position of text in a plot
> 
> See ?par, entry "usr". Either set a new coordinate system and 
> use it, or convert 1/10 to user coordinates.
> 
> In R-devel (2.7.0 to be) this is easier:
> 
>     text(grconvertX(0.1,"npc"), grconvertY(0.5, "npc"), "some text")
> 
> cnvrt.coords() in package TeachingDemos does something 
> similar (although it doesn't use the standard R names for 
> coordinate systems, and there are more than 5).
> 
> On Wed, 12 Mar 2008, Tom La Bone wrote:
> 
> >
> > What is the simplest way to specify the location of text in 
> a scatter 
> > plot (created using the plot function) in relative terms 
> rather than 
> > specific x-y coordinates? For example, rather than putting text at 
> > (300,49) on a plot, how do I put it 1/10 of the way over from the y 
> > axis and 1/2 of the way up from the x axis? Thanks.
> >
> > Tom
> 
> 
> -- 
> Brian D. Ripley,                  ripley at stats.ox.ac.uk
> Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
> University of Oxford,             Tel:  +44 1865 272861 (self)
> 1 South Parks Road,                     +44 1865 272866 (PA)
> Oxford OX1 3TG, UK                Fax:  +44 1865 272595
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide 
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 



More information about the R-help mailing list