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

2015-09-02 Thread Edzer Pebesma
On 09/02/2015 03:07 PM, Ben Tupper wrote: > 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

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

2015-09-02 Thread Ben Tupper
Hi, On Aug 30, 2015, at 6:37 AM, Edzer Pebesma 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

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

2015-08-30 Thread Edzer Pebesma
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. -- Edzer Pebesma Institute for

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

2015-08-29 Thread Tim Appelhans
Ben, as a follow up, it also works the other way round, which is more intuative: pols - spplot(spdfbb, colorkey = FALSE, sp.layout = list(b = list('sp.polygons', qa, col = 'grey', first = FALSE))) rst - spplot(R) combo - rst + as.layer(pols) combo I am not sure

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

2015-08-28 Thread Ben Tupper
Hello, I have drawn on the following posting to draw a raster 'under' a set of polygons as shown in the image link below. The data used is available at the third link (about 650KB). Posting: http://stackoverflow.com/questions/27062768/how-to-plot-additional-raster-with-spplot Image:

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

2015-08-28 Thread Tim Appelhans
Ben, you could specify the colorkey manually in the spplot call for spdfbb: sp::spplot(spdfbb, colorkey = list(col = bpy.colors(101), width = 1, at = seq(0, 30, length.out = 100), space = top), sp.layout = list(b =

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

2015-08-28 Thread Ben Tupper
Hi, Perfect! I wouldn't have gotten there in a hundred years. Thanks, Ben On Aug 28, 2015, at 10:51 AM, Tim Appelhans tim.appelh...@gmail.com wrote: Ben, you could specify the colorkey manually in the spplot call for spdfbb: sp::spplot(spdfbb, colorkey = list(col =

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

2015-08-28 Thread Ben Tupper
That works like a charm. It's sort of non-intuitive that I would use the colorkey argument for the plot of the polygons since color key is documented for levelplot. In my naive view I would looked to xyplot when plotting polygons. I'm still in the grope and thrash stage with lattice/spplot