how to adjust transparency when plotting spatial polygons over Open street maps map tiles? I can do it with ggmaps, but I have to do each color seperately.
code for get map tile from the OpenStreetMap package:
map = openproj(openmap(
c(lat= max(as.numeric(as.character(zip$INTPTLAT10))),
lon= min(as.numeric(as.character(zip$INTPTLON10)))),
c(lat= min(as.numeric(as.character(zip$INTPTLAT10))),
lon= max(as.numeric(as.character(zip$INTPTLON10)))),
type="osm"))
plot(map)
Heat map:
zip=readShapePoly( "tl_2010_04_zcta510.shp" )
zip$groups2=sample(1:10, length(zip[,1]), replace=T)
brks=classIntervals(zip$groups2, n=9, style="quantile")$brks
cols <- colors[findInterval(zip$groups2, brks, all.inside=TRUE)]
plot( zip , col = cols , axes=F , add=TRUE)
This is the phoenix .shp file from US census 2010.
"#D9D9D980"
– IRTFM