Re: [R] How to get aspect ratio as output from from plot()

From: Waichler, Scott R <Scott.Waichler_at_pnl.gov>
Date: Wed 12 Oct 2005 - 05:41:37 EST

Sundar,

> Perhaps this will work for you?
>
> plot(1:10)
> w <- par("pin")[1]/diff(par("usr")[1:2])
> h <- par("pin")[2]/diff(par("usr")[3:4])
> asp <- w/h

Thank you for your help. For vertical exaggeration I will make a slight change to make it more intuitive (for me):

w <- diff(par("usr")[1:2]) / par("pin")[1] # plot units per inch horizontal axis
h <- diff(par("usr")[3:4]) / par("pin")[2] # plot units per inch vertical axis
vertical.exaggeration <- w/h

Scott Waichler



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Oct 12 05:45:31 2005

This archive was generated by hypermail 2.1.8 : Sun 23 Oct 2005 - 18:41:15 EST