Reset the graphical parameters back to default values without use of dev.off()

If you already missed saving the default parameters at startup, and you don't want to restart the session, then you can open a terminal and run R by (usually) typing R.

Then type:

par()

It will print all the default values.

You can save them in a text file and import into the workspace that you are currently working in.


In RStudio, You can just navigate to 'Plots' and select 'Remove plots'


See ?par. The idea is that you save them as they are when you found them, and then restore:

old.par <- par(mar = c(0, 0, 0, 0))
## do plotting stuff with new settings

Now restore as they were before we changed mar:

par(old.par)

Tags:

R

Rstudio