[R] resetting par() to all defaults: par(reset=TRUE) ?
bbolker
bolker at ufl.edu
Sun Sep 30 17:38:29 CEST 2007
Michael Friendly wrote:
>
> In a long session, producing multiple graphs, I sometimes repeatedly
> change par() settings, particularly with multi-row/col displays.
> If I'm using a script, I'll do
>
> op <- par(newsettings)
> ... plots ...
> par(op)
>
> but sometimes I do things on the fly and can't easily back out
> to the default settings. I'm looking for someway to do the
> equivalent of
>
> par(reset=TRUE)
>
> I suppose I could do something like create Rprofile.site containing
>
> .First <- function() par.default <- par()
>
> and then par(par.default), but maybe there's an easier way I haven't
> noticed. [On Windows, I don't use Rprofile.site because it's one more
> thing to update with each new version.]
>
> -Michael
>
Your solution seems pretty good to me (although I often use Deepayan's
dev.off(); windows() hack myself), but I would amend it to
par.default <- par(no.readonly=TRUE)
Ben
--
View this message in context: http://www.nabble.com/resetting-par%28%29-to-all-defaults%3A-par%28reset%3DTRUE%29---tf4540681.html#a12966877
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list