Re: [R] Specifying relative position of text in a plot

From: Prof Brian Ripley <>
Date: Wed, 12 Mar 2008 15:13:09 +0000 (GMT)

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,        
Professor of Applied Statistics,
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Wed 12 Mar 2008 - 15:16:13 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 12 Mar 2008 - 18:30:21 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive