I have the following code which produces the map below. As you can see, the map correctly overlays two sets of polygons:
- A large polygon outlining the city of Liverpool
- A group of polygons outlining the 'MSOA' census components of the city
I'm happy with how it's outputting up to now, but I'd like to change the border opacity of the MSOA polygons so they are less bold and in-your-face. How can I do this?
The MSOA polygons are produced using the last line of the following code 'LiverpoolMSOA_LL'
ggmap(BaseMap) + stat_density2d(data=CrimeDatabase,aes(x=long, y=lat, fill= ..level.., alpha=..level..), size=1, bins=200, geom="polygon") + scale_fill_gradient(low="green",high="red") + scale_alpha(range=c(0.05,0.7), guide=FALSE) + geom_density2d(data=CrimeDatabase,aes(x=long, y=lat), size=0.3, bins=20, alpha=0.4) + # Main CIty Polygon # geom_polygon(data = Liverpool_LL, aes(x=long, y=lat, group=group), colour="black", fill=NA) + # MSOA Polygons - to have border opacity altered # geom_polygon(data = LiverpoolMSOA_LL, aes(x=long, y=lat, group=group), colour="black", fill=NA)
I have tried to use alpha=0.2 in both the aes() and after 'fill=NA' but this has not worked.
I have also tried rendering these polygons before the heatmap, but I'm not happy with the clarity of the borders so would prefer them to be on top.