I have a a polygon overlay of some adjoining government districts, I want to show data in the districts on separate maps, but as the bounding box for the basemap is smaller than the polygon the latter is is distorted:
The code I've used for this is
#basemap bounds
minmaxx <- c(-0.48384, -0.29955)
minmaxy <- c(51.2904, 51.41771)
mymapextent <- cbind(minmaxx, minmaxy)
districtboundary<- fortify(readShapePoly("maps/districts84/districts84.shp"))
pdistrictboundary<-geom_polygon(data=districtboundary, aes(x=long, y=lat, group=group), colour= "red", fill=NA)
map1 <- ggmap(get_map(location= bbox(mymapextent), source='osm', color='bw'))
map1 <- map1 + geom_point(data=pointstestlatlong, aes(Longitude_Decimal, Latitude_Decimal, colour=CasualtySeverity))
map1 <- map1 + pdistrictboundary
print(map1)
Is there a way I can clip the polygon to the bounding box?