[R-sig-Geo] strip in spplot do not show

Edzer Pebesma edzer.pebesma at uni-muenster.de
Wed Apr 7 21:48:13 CEST 2010


I browsed through the figures of Deepayan Sarkar's book on Lattice, and
found on http://lmdvr.r-forge.r-project.org/figures/figures.html figure
11.3, which seem to be what you need. Using his code, and building on
your example:

library(sp)
library(lattice)
data(meuse.grid)
coordinates(meuse.grid) <- c("x","y")
gridded(meuse.grid) <- TRUE
fullgrid(meuse.grid) <- TRUE
spplot(meuse.grid, zcol=c(1,2))
update(trellis.last.object(), layout = c(1, 1))[2]

Hth,

Jaime R. Garcia Marquez wrote:
> Dear list users,
> 
> Surely, a very simple question but I did not manage to solve it after a
> while trying.
> 
> I want to use spplot to plot one variable of a SpatialGridDataFrame BUT
> I want the normal lattice 'strip' to appear in the plot.
> 
> data(meuse.grid)
> coordinates(meuse.grid) <- c("x","y")
> gridded(meuse.grid) <- TRUE
> fullgrid(meuse.grid) <- TRUE
> 
> if I plot two variables
> 
> spplot(meuse.grid, zcol=c(1,2))
> 
> then the strip of each panel appears with the name of the variable, in
> this case 'part.a' and 'part.b'.
> 
> But if I plot just one variable the strip does not appear.
> 
> spplot(meuse.grid, zcol=1)
> 
> Not even when I specify the 'strip' argument
> 
> spplot(meuse.grid, zcol=1, strip=TRUE, names.attr="please show up")
> 
> spplot(meuse.grid, zcol=1, strip= strip.custom(var.names="Please show up"))
> 
> What am I missing???
> 
> Any help or suggestion is appreciated.
> 
> Best,
> 
> Jaime R.
> 
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo

-- 
Edzer Pebesma
Institute for Geoinformatics (ifgi), University of Münster
Weseler Straße 253, 48151 Münster, Germany. Phone: +49 251
8333081, Fax: +49 251 8339763  http://ifgi.uni-muenster.de
http://www.52north.org/geostatistics      e.pebesma at wwu.de



More information about the R-sig-Geo mailing list