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

Jim Lemon jim at bitwrit.com.au
Sat Aug 29 12:17:05 CEST 2009


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)
> (g_angle <- atan(2*myasp)*180/pi)
>   
Hi Levi,
Why not just:

plotpin<-par("pin")
myasp<-plotpin[2]/plotpin[1]

Jim




More information about the R-help mailing list