Skip to content
Prev 23296 / 29559 Next

sp and latticeExtra: add colorbar for layer drawn 'under'

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 = list('sp.polygons', qa, col = 'grey', 
first = FALSE))) +
   latticeExtra::as.layer(spplot(R, at = seq(0, 30, length.out = 100)), 
under = TRUE)


You simply need to make sure to pass the same specs to the spplot call to R.

HTH
Tim
On 28.08.2015 16:33, Ben Tupper wrote: