I'm doing a heatmap and I'm having trouble getting rid of those blue 'smudge' that are off the map. I would like to cut them off.
Here is what I did:
ggplot(dengue, aes(x=long, y=lat)) +
stat_density2d(aes(fill = ..level..), alpha=0.8, geom="polygon")+
geom_point(colour="red")+
geom_path(data=map.df,aes(x=long, y=lat,group=group), colour="grey50")+
scale_fill_gradientn(colours=rev(brewer.pal(5,"Spectral")))+
coord_fixed()