[R] Plotting multiple layers(maps) on same page

Nikhil Kaza nikhil.list at gmail.com
Tue Aug 3 22:31:35 CEST 2010

you will have a better luck with R-sig-geo.

Unfortunately I could not find an easy way for polygon overlays.
lines(ugbshape) if ugbshape was a polyline instead of a polygon.

Nikhil Kaza
Asst. Professor,
City and Regional Planning
University of North Carolina

nikhil.list at gmail.com

On Aug 3, 2010, at 12:54 PM, LCOG1 wrote:

> Hey guys and gals,
>   I searched through the forum and a bunch of R-mapping dedicated  
> sites but
> have not found what i know is quite elementary process, mapping more  
> than
> one layer on the same plot.  I need to show some reference lines for  
> the map
> to make sense.  I know the below wont work for anyone but to show  
> what im
> trying to do:
> TazFile <- "data/input/TAZ.shp"
> UGBFile<- "data/input/metugb.shp"
> TazShape <- readShapeSpatial(TazFile)
> UGBShape <- readShapeSpatial(UGBFile)
> #Write out to pdf
> pdf("Results/HhEmpForecast.pdf", width=8.2, height=11, onefile=TRUE)
> #Households
> plot(TazShape, col=colsHh[findInterval(TazShape$Hh, brksHh,
> all.inside=TRUE)])
> plot(UGBShape)
> title(main="Households Forecast by Taz")
> legend(4199277,860791.2,title="Total Households by
> Taz",LegBrksHh,fill=colsHh,cex=.8)
> #Employment
> plot(TazShape, col=colsEmp[findInterval(TazShape$Emp, brksEmp,
> all.inside=TRUE)])
> title(main="Employment Forecast by Taz")
> legend(4199277,860791.2,title="Total Employment by
> Taz",LegBrksEmp,fill=colsEmp,cex=.8)
> #Close file
> dev.off()
> I need Households and employment on separate maps but i need the UGB  
> file to
> be on each for reference. Doing it the above way obviously puts the
> reference map (UGB) on a separate map.  So how do i plot them on the  
> same
> page.  I thought this was easy enough but im not finding a simple  
> answer.
> Thanks for the help.
> In Solidarity,
> JR
> -- 
> View this message in context: http://r.789695.n4.nabble.com/Plotting-multiple-layers-maps-on-same-page-tp2312223p2312223.html
> Sent from the R help mailing list archive at Nabble.com.
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list