[R-sig-Geo] sp and latticeExtra: add colorbar for layer drawn 'under'

Ben Tupper btupper at bigelow.org
Wed Sep 2 15:07:17 CEST 2015


Hi,

On Aug 30, 2015, at 6:37 AM, Edzer Pebesma <edzer.pebesma at uni-muenster.de> wrote:

> On 08/29/2015 10:55 AM, Tim Appelhans wrote:
>> 
>> I am not sure why SpatialPolygons* objects get rendered via levelplot.
> 
> because levelplot has the understanding of plotting something in 2D,
> using colours according to the continuous variation of a third variable.

Thanks to you and Tim for the clarifications.  

I can see in the source code, spplot.R, that SpatialPolygonsDataFrame and SpatialLinesDataFrame are handled by levelplot; thanks for pointing that out. That SpatialPointsDataFrame is handled by xyplot gives me pause now.  In fact, if I think about it it confuses me, so I best not think about that first thing in the morning!

I agree with Tim that starting with the raster first and then adding the polygons with latticeExtra::as.layer() is more intuitive. 

Thanks again,
Ben

> -- 
> Edzer Pebesma
> Institute for Geoinformatics (ifgi),  University of Münster,
> Heisenbergstraße 2, 48149 Münster, Germany; +49 251 83 33081
> Journal of Statistical Software:   http://www.jstatsoft.org/
> Computers & Geosciences:   http://elsevier.com/locate/cageo/
> Spatial Statistics Society http://www.spatialstatistics.info
> 
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Ben Tupper
Bigelow Laboratory for Ocean Sciences
60 Bigelow Drive, P.O. Box 380
East Boothbay, Maine 04544
http://www.bigelow.org



More information about the R-sig-Geo mailing list