Re: [R-sig-Geo] Change range of values of the legend

2018-02-09 Thread Stefano Sofia
...@regione.marche.it ---Oo-oO Da: Ben Tupper [btup...@bigelow.org] Inviato: venerd� 9 febbraio 2018 16.01 A: Stefano Sofia Cc: r-sig-geo@r-project.org Oggetto: Re: [R-sig-Geo] Change range of values of the legend Hi, Try plot(rast, zlim = c(-5, 5)) I

Re: [R-sig-Geo] Change range of values of the legend

2018-02-09 Thread Ben Tupper
Hi, Try plot(rast, zlim = c(-5, 5)) I think the zlim argument is passed through to graphics::image() via fields::image.plot() which raster::plot() calls. I know it isn't super obvious until until you re-read the docs about 2000 times. Cheers, Ben > On Feb 9, 2018, at 9:39 AM, Stefano

[R-sig-Geo] Change range of values of the legend

2018-02-09 Thread Stefano Sofia
Dear list users, suppose that I have this simple raster: library(raster) xy <- matrix(rnorm(400),20,20) rast <- raster(xy) plot(rast) gives me a legend with range (-3,3). I would like to change the range of the legend to (-5,5), for example. I tried with plot(rast, legend=FALSE, axes=FALSE)