Skip to content
Prev 176090 / 398506 Next

temporarily modify par values?

Here is a minor variation:

par <- function( ... ) structure( graphics::par( ... ), class = "par" )
with.par <- function( data, expr, ... ) {
   on.exit(par(old.par, no.readonly = TRUE))
   old.par <- data
   invisible(expr)
}

which returns expr invisibly so that this works:

bp <- with(par(mar = c(4, 1, 1, 1)), boxplot(1:10))

On Sat, Apr 4, 2009 at 7:40 AM, Romain Francois
<romain.francois at dbmail.com> wrote: