[R-sig-Geo] plot order in spplot with sp.layout

Edzer Pebesma edzer.pebesma at uni-muenster.de
Mon May 23 15:25:49 CEST 2011



On 05/23/2011 03:13 PM, Tom Gottfried wrote:
> Dear list,
> 
> when doing the following, the grid is plotted on top of the sp.layout-item:
> 
> data(meuse.grid)
> coordinates(meuse.grid) <- ~x+y
> gridded(meuse.grid) <- TRUE
> data(meuse.riv)
> meuse.riv <- SpatialPolygons(list(Polygons(list(Polygon(meuse.riv)), 1)))
> spplot(meuse.grid, sp.layout=list("sp.polygons", meuse.riv))
> 
> ?spplot says:
> "for grids and polygons sp.layout is drawn afterwards (so the item will
> not be overdrawn by the grid and/or polygon)."
> 
> Do I misunderstand the documentation or is this a bug?

Please try:

spplot(meuse.grid, sp.layout=list("sp.polygons", meuse.riv,
  first = FALSE))

I added this now to the spplot documentation.

> 
> Thanks!
> Tom

-- 
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