[R-sig-Geo] How to show the color ramp legend with discrete data in spplot ?

Edzer Pebesma edzer.pebesma at uni-muenster.de
Tue Jan 22 19:14:16 CET 2013



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



More information about the R-sig-Geo mailing list