[R-sig-Geo] Map duo with lines connecting them

frosty goat frostygoat at gmail.com
Fri Nov 5 19:45:26 CET 2010


Hi, I wish to combine two maps on a single plot so that I can draw lines that
interact with each map. The maps are easily plotted side by side with
par(mfrow=c(1,2) or layout(matrix(c(1,2,1,2),2,2,byrow=T), BUT I don't think
there is a way to plot the lines that interact with each. 

Here is the code that will give you the idea of what I want to do:

library(maps)
#layout(matrix(c(1,2,1,2),2,2,byrow=T))
#par(mfrow=c(1,2))
##Map 1: State with counties that are the study region
map("state","washington",fill=T,col="white",names=TRUE,plot=T)
co=map("county",region=c("washington,chelan","washington,douglas","washington,okanogan","washington,grant"),col="gray",bg="gray",fill=T,plot=F)
polygon(co$x,co$y,col="darkgray",border="darkgray")
##Map 2: The study region, large in order to plot some study sites from lat
& long
c2=map("county",region=c("washington,chelan","washington,douglas","washington,okanogan","washington,grant"),fill=T,col="white",names=TRUE,plot=F)


So, I would like lines to go from the corners of the study region on the
state (overview) map to the corners on the bigger detailed study regions on
the second map, so it looks like it is popping out.

This seems to require the two maps to be one single map unified by the
coordinates, but clearly the state map covers a much broader lat and long
range.

Thanks for any ideas.  




-- 
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Map-duo-with-lines-connecting-them-tp5710206p5710206.html
Sent from the R-sig-geo mailing list archive at Nabble.com.



More information about the R-sig-Geo mailing list