How to show the color ramp legend with discrete data in spplot ?
On 01/21/2013 10:26 PM, Oscar Perpi?an wrote:
Hello,
I'll see how I can integrate this with spplot. Edzer Pebesma
Perhaps the approach of the figure 5.6 of the "Lattice" book can be more easily integrated in the spplot method: http://lmdvr.r-forge.r-project.org/figures/figures.html?chapter=05;figure=05_06;theme=stdBW;code=right It uses xyplot and displays the legend with draw.key.
Thanks for the suggestion.
I committed this to sp; in particular with sp from svn on r-forge one
can now e.g. do
loadMeuse()
spplot(meuse[c("lead", "zinc")], edge.col=1, colorkey=TRUE,
cuts=c(10,100,200,500,1000,2000))
edge.col = 1 results in black lines around the symbols,
colorkey = TRUE results in levelplot-type legend, instead the one with
the symbols; the default nr of colors used will also be large (100).
Comments welcome,
Edzer Pebesma Institute for Geoinformatics (ifgi), University of M?nster Weseler Stra?e 253, 48151 M?nster, Germany. Phone: +49 251 8333081, Fax: +49 251 8339763 http://ifgi.uni-muenster.de http://www.52north.org/geostatistics e.pebesma at wwu.de