A theme applies its margins through the before.plot.new hook,
so they live in the current graphics state but never reach par().
Rolling an ephemeral theme back therefore leaves par(plt) describing a
different region than the one we just drew into. Base R recomputes the
device clipping rectangle from par(), but only when xpd changes, so
anything added afterwards gets silently truncated to the wrong rectangle
as soon as some intervening call touches xpd (e.g. box(), mtext(),
or type_text(xpd = NA)). See #629.
Fix: put the original (drawn-into) region back, then hand mar_before
back at the next plot.new() so the theme's margins don't leak into the
following plot.
restore_plot_region(mar_before)NULL (called for side effect of resetting par("plt"))
Pre-theme inner margins (from par("mar"))