[R] Programming Question (setting ylim generally)

Mike Prager mike.prager at noaa.gov
Fri Jan 9 20:07:29 CET 2009


"stephen sefick" <ssefick at gmail.com> wrote:

> low <- min(a*0.98)-(min(a)*0.04)
> high <- max(a*1.02)+(max(a)*0.04)
> plot(a, ylim=c(low, high))

Unless I am misreading your example, this can be done a little
more compactly as:

plot(a, ylim = range(a * 0.94, a * 1.06))

-- 
Mike Prager, NOAA, Beaufort, NC
* Opinions expressed are personal and not represented otherwise.
* Any use of tradenames does not constitute a NOAA endorsement.




More information about the R-help mailing list