[R] best way to globally set parameters for base graphics

Martin Batholdy batholdy at googlemail.com
Mon Jul 20 17:27:06 CEST 2015


Hi,

I am looking for a way to modify the basic setup for any kind of plot.
(everything that is set with the par function – like margins, cex, las etc.)

I want to do this once – preferably across R sessions and not individually before every plot.


My first attempt was to add a par() with all my own defaults to the .Rprofile file.
This obviously does not work because par opens a new drawing device, applying its effect only to this device.

My next attempt was to write my own version of all basic plot functions (like plot, barplot etc.) adding a par() call within these functions.
This works but only if I draw a single plot. As soon as I want to use mfrow or layout to draw multiple plots side by side into one device this version also does not work, since each of these functions will open a new drawing device by themselves.


So, my question is;
Is there any way to globally define parameters given to par() so that they apply to all plots in (at least) an entire R-session?


Thank You!


More information about the R-help mailing list