OK, here is an example that I wrote in a 10 by 10 inch format. (Part of what upsets the use of par(fig = ) et al. Is that their effects are very dependent on the size of the plotter.)
Edited to add some clarification:
The base graphic parameter par("fig") describes / sets the location of the figure area in proportion to the "drawing area" (which is usually the entire device for single-line graphics). It takes a vector <4> of the form c(xmin, xmax, ymin, ymax) , consisting of numbers (proportions) between 0 and 1 .
Here I use grconvertX() and grconvertY() to convert xy locations expressed in terms of a larger coordinate system (aka "user" ) to the "ndc" coordinate system (normalized device coordinates). The coordinate system "user" more convenient for the user, and "ndc" (with the above caveats) is the coordinate system used by par("fig") . The grconvert*() call is intended to perform a translation between them.
## pdf("fig-in-fig.pdf", width=10, height=10) curve(exp(x), from=1, to=5, lwd=5) curve(150-exp(x), from=1, to=5, lwd=5, col="darkblue",add=T) ## Here the bit I added. par(fig = c(grconvertX(c(1, 3), from="user", to="ndc"), grconvertY(c(50, 125), from="user", to="ndc")), mar = c(4,6,1,1), new = TRUE) curve(exp(x), from=1, to=5, lwd=7, xlab="chi", ylab="exp(x)", cex.lab=4,axes=F) axis(1, labels=NA,at=c(0,5)) axis(2, labels=NA,at=c(0,150)) text(1,120,"Alpha",adj=c(0,0),cex=3) text(3.5,10,"Beta",adj=c(0,0),cex=3) ## dev.off()
