Skip to content

making an inset in a map figure

7 messages · Waichler, Scott R, Francisco Rodriguez Sanchez, MacQueen, Don +2 more

#
Hi, Does anyone have an example of making a map figure with an inset, where a portion of the map in the large figure is shown at a larger scale in the inset?

Scott Waichler
Hydrology Group
Pacific Northwest National Laboratory
Richland, WA, USA
#
What a coincidence! I was just having a look at this older message from 
the list that should solve the problem: 
https://stat.ethz.ch/pipermail/r-sig-geo/2012-June/015340.html

Cheers,

Paco


El 10/09/2013 17:00, Waichler, Scott R escribi?:

  
    
#
Perhaps use subplot() from the Hmisc package

-Don
1 day later
GD
#
# Something like

library(maptools)
data(wrld_simpl)

plot(wrld_simpl,border=NA,col='blue',axes=T, xlim=c(100,130),
ylim=c(-40,30))
par(plt = c(0.2, 0.5, 0.6, 0.8), new = TRUE)
plot(wrld_simpl,border=NA,col='green',bg='white',axes=F)

# If you put axes on the inset, they will fall over the background map --
but, you could fix that by drawing a white rectangle there first (e.g. using
rect). 



--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/making-an-inset-in-a-map-figure-tp7584585p7584607.html
Sent from the R-sig-geo mailing list archive at Nabble.com.