Re: [R] setting par(srt) according to plot aspect ratio

2009-08-29 Thread Jim Lemon
Levi Waldron wrote: For posterity's sake, here is the solution I figured out. Putting the following lines after the plot(f) command seems to set the angle correctly: myasp <- (par("fin")[2]-par("mai")[1]-par("mai")[3])/(par("fin")[1]-par("mai")[2]-par("mai")[4]) (f_angle <- atan(myasp)*180/pi)

Re: [R] setting par(srt) according to plot aspect ratio

2009-08-28 Thread Levi Waldron
On Fri, Aug 28, 2009 at 1:48 AM, Prof Brian Ripley wrote: > Note that the aspect ratio changes when you resize the plot but the angle > of the plotted text will not. So the only safe route is to set 'asp' and > use that setting to select the angle. That is true with screen output, although I ca

Re: [R] setting par(srt) according to plot aspect ratio

2009-08-27 Thread Levi Waldron
For posterity's sake, here is the solution I figured out. Putting the following lines after the plot(f) command seems to set the angle correctly: myasp <- (par("fin")[2]-par("mai")[1]-par("mai")[3])/(par("fin")[1]-par("mai")[2]-par("mai")[4]) (f_angle <- atan(myasp)*180/pi) (g_angle <- atan(2*mya

Re: [R] setting par(srt) according to plot aspect ratio

2009-08-27 Thread Levi Waldron
t: Thursday, August 27, 2009 1:54 PM > To: r-help@r-project.org > Subject: [R] setting par(srt) according to plot aspect ratio > > How can I look up the aspect ratio of a plot, so I can use that to > correctly > adjust the angle of text which is supposed to be parallel to a line in

[R] setting par(srt) according to plot aspect ratio

2009-08-27 Thread Levi Waldron
How can I look up the aspect ratio of a plot, so I can use that to correctly adjust the angle of text which is supposed to be parallel to a line in the plot? The following example code works for a 1:1 aspect ratio, but puts the text at the wrong angle if the plot region is short and wide or tall a