s-news
[Top] [All Lists]

Re: How to set the default par font = 2?

To: Max Zhao <mzhao@homer.att.com>
Subject: Re: How to set the default par font = 2?
From: Prof Brian Ripley <ripley@stats.ox.ac.uk>
Date: Fri, 10 Mar 2006 07:18:34 +0000 (GMT)
Cc: s-news@lists.biostat.wustl.edu
In-reply-to: <025401c64169$ac7247e0$775e2e87@zhaopc>
References: <73768858AB9BC848BF705250792A8A8D0836C8@EXCHSRVR02.int.milano> <025401c64169$ac7247e0$775e2e87@zhaopc>
par() applies to the currently open graphics device.

I don't know a way to change the defaults used when a device is first opened, but you could write a wrapper function to open a device and then change par().

As for your example code, you need to call the par() function and not assign to an object of that name. If you had

.First <- function() par(font=2)

it would open a device (a graphsheet in your case) and then change par("font") on that device, put have no effect on subsquent devices.


On Mon, 6 Mar 2006, Max Zhao wrote:

Dear All,

I am trying to set the default font to 2, instead of the Splus default 1. I tried to put it in my .First function so that every time Splus is started, the default font would be 2 for each graphic device that is invoked. Here is what I thought should work, but it did not. Does anybody know how to solve the question?

################
.First_function()
{
    tPar <- par()
    tPar$font <- 2
    assign("par", tPar)
}

I am using Splus 6.2 in Windows XP environment.
Thanks in advance.
Max


--
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

<Prev in Thread] Current Thread [Next in Thread>