[R] Trellis.par.set/ family/ global change font?

Prof Brian Ripley ripley at stats.ox.ac.uk
Fri Jun 30 08:35:29 CEST 2006


On Fri, 30 Jun 2006, Renaud Lancelot wrote:

> A radical solution is to edit the file .../etc/Rdevga and to change
> the definition of the first set of fonts, e.g.
>
> # TT Arial : plain
> # TT Arial : bold
> # TT Arial : italic
> # TT Arial : bold&italic
>
> TT Times New Roman : plain
> TT Times New Roman : bold
> TT Times New Roman : italic
> TT Times New Roman : bold&italic

He is on Linux, so that will not work.  We have not been told the graphics 
device, but both postscript() and pdf() allow the device to be set when 
the device is opened, and that works for me:

pdf(family="serif")
example(xyplot)
dev.off()


>
> Best,
>
> Renaud
>
> 2006/6/30, Deepayan Sarkar <deepayan.sarkar at gmail.com>:
>> On 6/29/06, McClatchie, Sam (PIRSA-SARDI)
>> <mcclatchie.sam at saugov.sa.gov.au> wrote:
>>> Background:
>>> OS: Linux Ubuntu Dapper 6.06
>>> release: R 2.3.1
>>> editor: GNU Emacs 21.4.1
>>> front-end: ESS 5.2.3
>>> ---------------------------------
>>>
>>> Colleagues
>>>
>>> I have a rather complicated trellis plot that a journal editor has requested I edit and change all the fonts to times.
>>>
>>> I'd like to change all fonts globally for the plot, as in par(family="serif") for non-trellis plots. Various experiments with trellis.par.set after reading the help page have not solved the problem for me. Even doing the local change
>>> trellis.par.set(par.xlab.text=list(cex=1.5, family="serif")) does not change the font to times for xlab (I mean my syntax is wrong, not that there is a bug).
>>>
>>> So I'm obviously misreading the help page or just missing the meaning. Any suggestions?
>>
>> Lattice uses 'fontfamily' rather than 'family' (borrowed from grid, I
>> suppose). I don't think there's a way to set the family globally. You
>> might try
>>
>> trellis.par.set(grid.pars = list(fontfamily = "serif"))
>>
>> but I'm not sure if that will work.
>>
>> -Deepayan
>>
>> ______________________________________________
>> R-help at stat.math.ethz.ch mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>>
>
>
>

-- 
Brian D. Ripley,                  ripley at 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



More information about the R-help mailing list