[R] exact range of axes in plots

Ross Ihaka ihaka at stat.auckland.ac.nz
Mon Feb 24 20:28:03 CET 2003


Jason Bond wrote:
> 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,

After you have created the plot try par("usr").  This gives 4 values:
xmin, xmax, ymin, ymax.

 > plot(1:10, 1:10)
 > par("usr")
[1]  0.64 10.36  0.64 10.36


-- 
Ross Ihaka                         Email:  ihaka at stat.auckland.ac.nz
Department of Statistics           Phone:  (64-9) 373-7599 x 85054
University of Auckland             Fax:    (64-9) 373-7018
Private Bag 92019, Auckland
New Zealand




More information about the R-help mailing list