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

Oscar Perpiñan Lamigueiro oscar.perpinan at upm.es
Tue May 24 11:42:32 CEST 2011


Hello,

I find useful the layer and layer_ mechanism of latticeExtra:

p <- spplot(meuse.grid)

p + layer(sp.polygons(meuse.riv))

p + layer_(sp.polygons(meuse.riv))

Cheers,

Oscar.

-------------------
Oscar Perpiñán Lamigueiro
Dpto. Ingeniería Eléctrica
EUITI-UPM

http://procomun.wordpress.com

-----------------------------------------
>Hi,
>
>An alternative approach is to use a custom panel function, which is
>even more flexible that the solution Edzer suggested. To add polygons
>and points to a grid map using a custom panel function:
>
>spplot(grid_object, "layer_to_plot",
>     panel = function(...) {
>         panel.gridplot(...)
>         sp.polygons(polygon_object)
>         sp.points(point_object)
>     })
>
>see also the R wiki article on spatial data visualization [1].
>
>cheers,
>Paul
>
>[1] 
>http://rwiki.sciviews.org/doku.php?id=tips:spatial-data:spatial_data_visualization
>
>



More information about the R-sig-Geo mailing list