[R] Clip contour or image

Kaspar Pflugshaupt pflugshaupt at cirsium.ethz.ch
Fri Mar 16 17:52:17 CET 2001


On Friday 16 March 2001 20:20, Han Lai wrote:
> Hi,
>
> I am almost new to R.  Would any one show me (please include an example)
> how to clip a contour or image figure so that I only see the image or
> lines inside a selected area?

You can use the xlim/ylim parameters (see help(plot.default) ) to specify 
each axis' start and end value:

> x <- 1:50  
> y <- 1:50
> z <- outer(x,y)
> image(z)
> image(z, xlim=c(0.2,0.5))
> image(z, xlim=c(0.2,0.5), ylim=c(0,0.5))

The same works with contour().

If you wanted to clip _within_ the graphics area, I'm not sure if or how that 
would work.


HTH

Kaspar Pflugshaupt

-- 


Kaspar Pflugshaupt
Geobotanical Institute
ETH Zurich, Switzerland

http://www.geobot.umnw.ethz.ch
mailto:pflugshaupt at geobot.umnw.ethz.ch
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list