Skip to content
Back to formatted view

Raw Message

Message-ID: <20110524114232.18a8be5b@OPL-EUITI>
Date: 2011-05-24T09:42:32Z
From: Oscar PerpiƱan
Subject: plot order in spplot with sp.layout
In-Reply-To: <4DDB5FDE.1030408@geo.uu.nl>

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