Re: [R] Draw text with a box surround in plot.

2010-06-09 Thread Peter Ehlers
Maybe this can be display-dependent. I just measured the two diagonals on the plot and they're equal to within less than one mm (possibly closer but that was the accuracy of my measuring device (pencil and strip of paper)). -Peter Ehlers On 2010-06-09 16:57, g...@ucalgary.ca wrote: For me, the

Re: [R] Draw text with a box surround in plot.

2010-06-09 Thread guox
For me, the angles circled are not exactly right. See the pdf file: plot.pdf. But it is OK. Thanks Peter for your directions -james > On 2010-06-09 14:17, g...@ucalgary.ca wrote: >> Thank. >> Better. Seems that angles are close to but not equal to pi/2. >> It may be because the plot box is not a sq

Re: [R] Draw text with a box surround in plot.

2010-06-09 Thread Peter Ehlers
On 2010-06-09 14:17, g...@ucalgary.ca wrote: Thank. Better. Seems that angles are close to but not equal to pi/2. It may be because the plot box is not a square: the length of x-axis is not the same as the length of y-axis. Even curves y = x and y = 1-x look like not orthogonal but they should si

Re: [R] Draw text with a box surround in plot.

2010-06-09 Thread Greg Snow
ject: Re: [R] Draw text with a box surround in plot. > > Rectangle R centered at (x,y) with width 2w and height 2h is given by > > x1=x-w > y1=y-h > x2=x+w > y2=y-h > x3=x+w > y3=y+h > x4=x-w > y4=y+h > polygon(c(x1,x2,x3,x4),c(y1,y2,y3,y4)) > > Rotating

Re: [R] Draw text with a box surround in plot.

2010-06-09 Thread guox
Thank. Better. Seems that angles are close to but not equal to pi/2. It may be because the plot box is not a square: the length of x-axis is not the same as the length of y-axis. Even curves y = x and y = 1-x look like not orthogonal but they should since multiplication of their slopes is -1. -jame

Re: [R] Draw text with a box surround in plot.

2010-06-09 Thread Peter Ehlers
Your transformation assumes that the x- and y-axes are on the same scale. Add 'asp = 1' to your plot() call to set the appropriate aspect ratio. -Peter Ehlers On 2010-06-09 10:13, g...@ucalgary.ca wrote: Rectangle R centered at (x,y) with width 2w and height 2h is given by x1=x-w y1=y-h x2=x

Re: [R] Draw text with a box surround in plot.

2010-06-09 Thread guox
Rectangle R centered at (x,y) with width 2w and height 2h is given by x1=x-w y1=y-h x2=x+w y2=y-h x3=x+w y3=y+h x4=x-w y4=y+h polygon(c(x1,x2,x3,x4),c(y1,y2,y3,y4)) Rotating a point (u,v) at (0,0) by theta degree is given by matrix [cos(theta),-sin(theta) sin(theta),cos(theta)] so we have a new

Re: [R] Draw text with a box surround in plot.

2010-06-03 Thread Bert Gunter
: [R] Draw text with a box surround in plot. On 2010-06-02 16:57, g...@ucalgary.ca wrote: > text() can draw text on a plot. > Do we have a way/function to draw text with a box surround it? > Thanks, > There may be a function in some package, but I would just use rect(). ?rect -

Re: [R] Draw text with a box surround in plot.

2010-06-03 Thread Jim Lemon
On 06/03/2010 08:57 AM, g...@ucalgary.ca wrote: text() can draw text on a plot. Do we have a way/function to draw text with a box surround it? Hi james, Have a look at boxed.labels and textbox in the plotrix package. Jim __ R-help@r-project.org mail

Re: [R] Draw text with a box surround in plot.

2010-06-02 Thread Peter Ehlers
On 2010-06-02 16:57, g...@ucalgary.ca wrote: text() can draw text on a plot. Do we have a way/function to draw text with a box surround it? Thanks, There may be a function in some package, but I would just use rect(). ?rect -Peter Ehlers __ R-help

[R] Draw text with a box surround in plot.

2010-06-02 Thread guox
text() can draw text on a plot. Do we have a way/function to draw text with a box surround it? Thanks, -james __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/pos