[R] Plot zooming i.e. changing ylim according to xlim

From: Henrik Andersson <h.andersson_at_nioo.knaw.nl>
Date: Tue 26 Jul 2005 - 18:16:12 EST

Dear R-gurus,

I would like to zoom in a plot, e.g. I select a region on the x-axis and then I would like the ranges on the y-axis to change accordingly.

Is it possible to do this with existing functions, or do I have to invent some data selection before plotting?

See below a short example, where I select ylim with trial and error, which I want to avoid.

Cheers, Henrik Andersson

## Example -- in reality more numbers, no function
x <- seq(0,20)
y <- exp(-x)


## Zoom in the end, to see what's happenning


## Try other ylim


## Not enough


## Better

Henrik Andersson
Netherlands Institute of Ecology -
Centre for Estuarine and Marine Ecology
P.O. Box 140
4400 AC Yerseke
Phone: +31 113 577473

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 Tue Jul 26 18:22:04 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:34:01 EST