Skip to content

Using ggplot2 to plot a shapefile

3 messages · Robert J. Hijmans, Zev Ross

#
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
#
Zev,

Here is an example:
http://blog.revolution-computing.com/2009/11/choropleth-challenge-result.html

Robert
On Tue, Mar 2, 2010 at 9:07 AM, Zev Ross <zev at zevross.com> wrote: