subplot(fun, x, y, size=c(1, 1), vadj=.5, hadj=.5, pars=NULL)
The returned value can be used to add to the subplot.
usa(xlim=c(-76.3, -65), ylim=c(39.2, 47.6)) subpars <- subplot(usa()) # locator is used to place the new plot subplot(box(), pars=subpars) # puts box around the small usa map subplot(box()) # use locator to box the enlarged area text(locator(1), "Enlarged Region")year <- as.integer(dimnames(votes.repub)[[2]]) southwest <- match(c("California", "Nevada", "Utah", "New Mexico", "Arizona", "Colorado"), state.name) fun <- expression({ plot(year, votes.repub[s,], xlab="", ylab="", main="", type="l", cex=.5, xlim=c(1900, 1980), ylim=c(0, 100)) abline(h=50) }) rx <- c(101, 125); ry <- c(30.5, 42.5) usa(xlim=rx, ylim=ry) for (s in southwest) subplot(x=state.center$x[s], y=state.center$y[s], size=c(1.0,.6), fun=fun) title(main="Republican Votes in the Southwest")