[R] exact range of axes in plots

Ko-Kang Kevin Wang Ko-Kang at xtra.co.nz
Mon Feb 24 20:32:09 CET 2003


Hi,

----- Original Message -----
From: "Jason Bond" <jbond at arg.org>
To: <R-help at stat.math.ethz.ch>
Sent: Tuesday, February 25, 2003 8:06 AM
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,

Is xlim and ylim in the plot() what you want?  For example:
    > x <- rnorm(100)
    > plot(x)
    > plot(x, xlim = c(20, 80), ylim = c(-2, 2))
the second plot() will restrict the range of x-axis to be between 20 and 80,
y-axis between -2, 2.

Cheers,

Kevin




More information about the R-help mailing list