dankelley/oce — Issue #190: plotInset() fails with par(mfrow=c(2,1))
Author: richardsc
Created: 2012-01-25 14:19:03+00:00
State: open

Example:

pf <- function() {
plot(time(adp), pressure(adp), type='l', axes=F, xlab='', ylab='')
grid()
axis(1, labels=F, tcl=0.5)
axis(2, labels=F, tcl=0.5)
box()
}
data(adp)
par(mfrow=c(2,1))
plot(adp, which=3)
inset <- c(as.numeric(time(adp)[1]+3600), 5, as.numeric(time(adp)[1]+10*3600), 15)
plotInset(inset[1], inset[2], inset[3], inset[4], expr=pf(), mar=c(0,0,0,0))

Error in plot.new() : figure margins too large

I even tried setting the margins to zero, so I don't understand why they are too large. It works fine if `mfrow=c(1,1)`.