Re: [R] Coordinates of the text region

From: Francois Rousseu <francoisrousseu_at_hotmail.com>
Date: Sat, 26 Mar 2011 21:05:49 -0400

Let's say I do the following:  

plot(0,0,type="n",xlim=c(0,10),ylim=c(0,10))
rect(4,5,5,6,border="black",col="white")
text(4.5,5.5,"species",cex=2)
 

I would like to be able to determine a rectangle size that will be able to contain the text species. I'm working on a function using multiple lines and boxes where text of varying length has to be written.  

Francois    

>
> On Mar 26, 2011, at 8:39 PM, Francois Rousseu wrote:
>
> >
> > Hello R people
> >
> > Is there a way to get the coordinates of the text region
> > (coordinates of the four corners for example)
>
> What "text region" are you talking about?
>
> > when using the text function? I'm looking for a way that does not
> > make use of interactive function like locator. My goal is to
> > determine the position of other structures in a graphic so that they
> > don't overlap with the text.
>
> The plotrix package and the rms package have functions for avoiding
> plotted points but you seem to be looking for something else.
>
> --
>
> David Winsemius, MD
> West Hartford, CT
>
                                               

        [[alternative HTML version deleted]]



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. Received on Sun 27 Mar 2011 - 01:10:47 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 Sun 27 Mar 2011 - 02:00:24 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive