[R-sig-Geo] Same scale legend in two or more maps

Jose.M.Pavia at uv.es Jose.M.Pavia at uv.es
Wed Apr 11 15:25:34 CEST 2012


Dear list,
This is the issue.

The same country in three different moments of time.
The country is divided in polygons. 
The division in polygons is not the same in the three moments of time.

We have a variable observed in each polygon in the three moments and
we want to construct a map for each moment using the same scale in the
three moments. This does not seem to be a problem. 
We reach this by:
rrt <- c(v1,v2,v3) # variables to map
brks <- quantile(rrt, seq(0,1,1/100)) # breaks
cols <- grey((length(brks):2)/length(brks)) # color palette

And then we plot the maps in the same window:
par(mfrow=c(1,3), mar=c(0,0,0,0))
plot(map1, col=cols[findInterval(v1, brks, all.inside=TRUE)])
plot(map2, col=cols[findInterval(v2, brks, all.inside=TRUE)])
plot(mpa3, col=cols[findInterval(v3, brks, all.inside=TRUE)])

The problem is using a same (grey) scale legend for the three maps and
just one!

Any idea?
Thanks in advance

Jose M Pavia



More information about the R-sig-Geo mailing list