Hi,

Use xlim and ylim. With your example:

levelplot(r, xlim=c(-100, 100), ylim=c(-50, 50),
          col.regions=c('palegreen', 'midnightblue', 'indianred1'))

Best,

Oscar.

Oscar Perpiñán Lamigueiro
Grupo de Sistemas Fotovoltaicos (IES-UPM)
Dpto. Ingeniería Eléctrica (EUITI-UPM)
URL: http://procomun.wordpress.com
Twitter: @oscarperpinan


2013/5/4 Thiago V. dos Santos <thi_veloso@yahoo.com.br>

> Hello everyone,
>
> Is there any way to plot a geographical subset of a raster using the plot
> techniques of rasterVis? Here's an example of the rasterVis manual:
>
> ## Categorical data
> require(raster)
> require(rasterVis)
> r <- raster(nrow=10, ncol=10)
> r[] = 1
> r[51:100] = 3
> r[3:6, 1:5] = 5
> r <- ratify(r)
> rat <- levels(r)[[1]]
> rat$landcover <- c('Pine', 'Oak', 'Meadow')
> levels(r) <- rat
> levelplot(r, col.regions=c('palegreen', 'midnightblue', 'indianred1'))
>
>
> How could I plot only, say, latitude -50 to 50 and longitude -100 to 100?
>
> Thanks in advance,
> --
> Thiago V. dos Santos
> PhD student
> Land and Atmospheric Science
> University of Minnesota
>
> http://www.laas.umn.edu/CurrentStudents/MeettheStudents/ThiagodosSantos/index.htm
> Phone: (612) 323 9898
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

	[[alternative HTML version deleted]]

