png("Web/custombase-baseregions1fig.png", width=640, height=640) par(oma=rep(3, 4), bg="grey80") plot(c(0, 1), c(0, 1), type="n", ann=FALSE, axes=FALSE) box("outer", col="grey") # set clipping to figure region par(xpd=TRUE) # deliberately draw a stupidly large rectangle rect(-1, -1, 2, 2, col="grey90") box("figure") # set clipping back to plot region par(xpd=FALSE) # deliberately draw a stupidly large rectangle rect(-1, -1, 2, 2, col="grey80") box("plot", lty="dashed") text(.5, .5, "Plot Region") mtext("Figure Region", side=3, line=2) for (i in 1:4) mtext(paste("Outer margin", i), side=i, line=1, outer=TRUE) dev.off()