[R] exact range of axes in plots

Marc Schwartz mschwartz at medanalytics.com
Mon Feb 24 20:36:15 CET 2003

>-----Original Message-----
>From: r-help-admin at stat.math.ethz.ch 
>[mailto:r-help-admin at stat.math.ethz.ch] On Behalf Of Jason Bond
>Sent: Monday, February 24, 2003 1:06 PM
>To: R-help at stat.math.ethz.ch
>Subject: [R] exact range of axes in plots
>Hello.  I was wondering how one can find the exact values of 
>the range of 
>an axis within a plot.  In xlispstat it was (send plot :range 
>0).  Thanks much,
>   Jason

See ?par

Specifically par("usr"), which will give you the actual range of the x
and y axes.

par("xaxp") or par("yaxp") will also give you information on the axis
tick marks.

Be aware that the above pars are altered when log scales are used, so
be sure to read the help file carefully in that situation.

If you want to SET the axis ranges explicitly, most of the plotting
functions take the arguments 'xlim' and 'ylim', which can be used for
that purpose.


Marc Schwartz

More information about the R-help mailing list