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

From: Sundar Dorai-Raj <sundar.dorai-raj_at_pdf.com>
Date: Wed 12 Oct 2005 - 04:44:01 EST

Waichler, Scott R wrote:
> Is there a way to get the aspect ratio as output from a plot() call or
> something similar in the base graphics system? I would like to note
> vertical exaggeration on an elevation profile.
>
> Thanks,
> Scott Waichler
> Pacific Northwest National Laboratory
> scott.waichler@pnl.gov
>

Hi, Scott,

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

HTH, --sundar



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 04:59:53 2005

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