Reset par to the default values at startup

前端 未结 6 1117
情书的邮戳
情书的邮戳 2020-12-02 07:52

Normally when I make my own plot functions, I make a construct :

op <- par(\"mypar\"=myvalue)
on.exit(par(op))

which is the standard way

6条回答
  •  醉酒成梦
    2020-12-02 08:11

    dev.off() is the best function, but it clears also all plots. If you want to keep plots in your window, at the beginning save default par settings:

    def.par = par()

    Then when you use your par functions you still have a backup of default par settings. Later on, after generating plots, finish with:

    par(def.par) #go back to default par settings

    With this, you keep generated plots and reset par settings.

提交回复
热议问题