Here is an example using the subplot function:

library(TeachingDemos)
library(maptools)
data(wrld_simpl)

plot(wrld_simpl,border=NA,col='blue',axes=TRUE, xlim=c(100,130),
ylim=c(-40,30))

tmp <- subplot(
   plot(wrld_simpl,border=NA,col='green',bg='white',axes=FALSE),
   'bottomleft', size=c(2,1), inset=c(0.01,0.01))

tmp2 <- par('usr')

tmp3 <- subplot(
plot(wrld_simpl, border='red', axes=TRUE, xlim=c(95,105),
ylim=c(-5,5), bg='lightgrey'),
'topright', size=c(2,2))

par(xpd=TRUE)  # reset clipping region
rect( tmp3$usr[1], tmp3$usr[3], tmp3$usr[2], tmp3$usr[4], border='orange' )

op <- par(tmp[c('plt','usr')])
rect( tmp2[1], tmp2[3], tmp2[2], tmp2[4], border='red' )
par(op)


I use subplot from TeachingDemos, the version in Hmisc is a copy of the one
in TeachingDemos.


On Tue, Sep 10, 2013 at 10:00 AM, Waichler, Scott R <Scott.Waichler@pnnl.gov
> wrote:

> 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
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



-- 
Gregory (Greg) L. Snow Ph.D.
538280@gmail.com

	[[alternative HTML version deleted]]

