Skip to content
Prev 7755 / 29559 Next

Using ggplot2 to plot a shapefile

Hi All,

I'm using the ggplot2 library to make some plots and I'm wondering how I 
could plot a shapefile along with my points

# I use this to plot my points
p<-ggplot(elev,aes(X, Y))+geom_point(aes(color=Elev, size=Elev))

# here I read in the county shapefile
counties<-readShapePoly("X:/counties_teale.shp")

# how do I add this to my plot would I use geom_polygon somehow?

Thank you, Zev