[R-sig-Geo] modify legend on levelplot

Tyler Frazier tyler.j.frazier at icloud.com
Wed Sep 17 22:01:04 CEST 2014


I would like to modify my legend on a rasterVis levelplot() but can’t figure it out.

I use

p <- levelplot(x_rat, main = “title", margin = FALSE, xlab = NULL, ylab = NULL, auto.key=list(space="top", columns=3), col.regions=c(‘gray','darkgreen','tomato4','yellow','purple','blue','azure2','orange','hotpink','peachpuff','salmon2'))
p + layer(sp.lines(borders, lwd=1.2, col='gray60'))

with the idea that the auto.key command will center the legend at the top of the plot, three items at a time (3 per column, 4 rows with the last row having 2).  

I would also like to locate the legend inside the borders over part of the main plot area where the map is less informative (with an opaque white background inside the legend box).

Any suggestions would be appreciated.

Thank you,
Tyler Frazier
Center for Development Research (ZEF-C)
University of Bonn
53113 Bonn, DE
+49 (0) 228 73 4949 (office)
+49 (0) 152 1018 2718 (handy)

	[[alternative HTML version deleted]]

More information about the R-sig-Geo mailing list