I know how to set graphic parameters by calling par(), but what I'd like is a way to set the default values so that subsequent calls to par() use my defaults. The reason to want this is that every time I create a new graphic window (I'm using quartz on OSX, and so far no answers in the Mac mailing list), my parameters get reset to the builtin defaults. I read about the "unexported variable .Pars," but would like to know if there's any way to manipulate that variable. thanks Carl
One way that I do it is to save the default parameters with the following statement in my profile: assign('Default.par', par(no.readonly=T)) An then I have a function which will reset them: plotReset <- function() { # reset plotting window par(Default.par) windows(width=7.5,height=4.7, record=T, pointsize=10) } On Sun, Jul 13, 2008 at 6:31 PM, Carl Witthoft <carl at witthoft.com> wrote:> I know how to set graphic parameters by calling par(), but what I'd like is > a way to set the default values so that subsequent calls to par() use my > defaults. The reason to want this is that every time I create a new graphic > window (I'm using quartz on OSX, and so far no answers in the Mac mailing > list), my parameters get reset to the builtin defaults. > I read about the "unexported variable .Pars," but would like to know if > there's any way to manipulate that variable. > > thanks > Carl > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem you are trying to solve?
Write a function that opens a new graphics window (quartz in your case) then changes the parameters to what you want as the default. Then any time you want/need a new graphics window, call your function. Also look at ?options and scroll down to 'device' and ?Startup Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.snow at imail.org (801) 408-8111> -----Original Message----- > From: r-help-bounces at r-project.org > [mailto:r-help-bounces at r-project.org] On Behalf Of Carl Witthoft > Sent: Sunday, July 13, 2008 4:31 PM > To: r-help at r-project.org > Subject: [R] any way to set defaults for par? > > I know how to set graphic parameters by calling par(), but > what I'd like is a way to set the default values so that > subsequent calls to par() use my defaults. The reason to > want this is that every time I create a new graphic window > (I'm using quartz on OSX, and so far no answers in the Mac > mailing list), my parameters get reset to the builtin defaults. > I read about the "unexported variable .Pars," but would like > to know if there's any way to manipulate that variable. > > thanks > Carl > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >