[R] spplot : help with legend

Ana rrasterr at gmail.com
Wed Jan 11 14:08:25 CET 2012


Hi!

I am looking for some examples on how to plot using spplot the overlay
of :polygon+point+point
both point files are different files with different coordinates.

I am planning on doing something like this:

polygon.file=readShapeSpatial(polygons)
l1 = list("sp.points", points.file1, pch = 19,col = "red")
l2 = list("sp.points", points.file2, pch = 19,col = "green")

spplot(polygon.file, "common",col="black", sp.layout = list(l1,l2))

However I didn't find any help on how to do the legend, except for
these examples:
http://www.nceas.ucsb.edu/scicomp/usecases/CreateMapsWithRGraphics
http://casoilresource.lawr.ucdavis.edu/drupal/node/962

It seems there is a way to do it, but too confusing for me (mapLegendGrob2)

Any help is appreciated!



More information about the R-help mailing list