On Thu, 13 Mar 2008, Tom La Bone wrote:
> Thanks for all of the suggestions. The key key here seems to be using the
> "par" function to change the coordinate system like so
>
> plot(rnorm(100), rnorm(100))
> op <- par("usr")
> par(usr = c(0, 1, 0, 1))
> text(0.5,0.5,"TEST")
> par(usr = op)
>
> Pro
Thanks for all of the suggestions. The key key here seems to be using the
"par" function to change the coordinate system like so
plot(rnorm(100), rnorm(100))
op <- par("usr")
par(usr = c(0, 1, 0, 1))
text(0.5,0.5,"TEST")
par(usr = op)
Prof Ripley commented that this approach will also work on l
one
Sent: Thursday, 13 March 2008 12:34 AM
To: r-help@r-project.org
Subject: [R] Specifying relative position of text in a plot
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
Subject: Re: [R] Specifying relative position of text in a plot
>>
>>
>> Tom La Bone asked:
>>>
>>> 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
>
nal Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Nordlund,
> Dan (DSHS/RDA)
> Sent: Wednesday, March 12, 2008 12:26 PM
> To: Alberto Monteiro; Tom La Bone; r-help@r-project.org
> Subject: Re: [R] Specifying relative position of text in a plot
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Alberto Monteiro
> Sent: Wednesday, March 12, 2008 10:28 AM
> To: Tom La Bone; r-help@r-project.org
> Subject: Re: [R] Specifying relative position of text in a plot
>
&
-8111
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Prof Brian Ripley
> Sent: Wednesday, March 12, 2008 9:13 AM
> To: Tom La Bone
> Cc: r-help@r-project.org
> Subject: Re: [R] Specifying relative position of text in a plot
Tom La Bone asked:
>
> 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 f
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 d
Try this:
plot(rnorm(100))
text(diff(par("usr")[1:2])/10, sum(par("usr")[3:4])/2, labels="Test")
On 12/03/2008, Tom La Bone <[EMAIL PROTECTED]> 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 tha
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
11 matches
Mail list logo