Re: [R] changing font size in plot(effect())

From: John Fox <>
Date: Thu 25 May 2006 - 19:20:17 EST

Dear Emilie,

This is, I guess, the effect() function in the effects package. If so, note that the plot.effect() method uses trellis graphics (via the lattice package), not standard R graphics, so you have to control aspects of the plot in a manner consistent with trellis graphics.

Unfortunately, you can't just specify the scales argument when you call plot(), since plot.effect() already includes a scales argument when it calls xyplot(). You can, however, set trellis parameters globally, e.g., via something like

axis.text <- trellis.par.get("axis.text")
par.ylab.text <- trellis.par.get("par.ylab.text")
par.xlab.text <- trellis.par.get("par.xlab.text")
axis.text$cex <- 1.5
par.ylab.text$cex <- 1.5
par.xlab.text$cex <- 1.5
trellis.par.set("axis.text", axis.text)
trellis.par.set("par.ylab.text", par.ylab.text)
trellis.par.set("par.xlab.text", par.xlab.text)

Perhaps this can be done more efficiently -- I'm far from a trellis whiz -- but the above should work.

More generally, in designing the plot method for effect objects, it wasn't my goal to produce publication-quality plots; for that, I suggest that you build a custom graph using the information included in the effect object.

I hope this helps,

On Wed, 24 May 2006 13:24:03 -0400
 Emilie Berthiaume <> wrote:

> I can't seem to be able to change the font size in an effect display.
> I've
> tried the following:
> > par(cex.lab=4)
> > plot(effect ("alti",reg8), ylab="detection probability")
> and
> > plot(effect ("alti",reg8), ylab="detection probability", cex=4)
> but nothing changes. Can anyone help me?
> thanks.
> Emilie Berthiaume
> graduate student
> Sherbrooke University
> 2500 boul. de l'Université
> Sherbrooke, Québec
> Phone: 1-819-821-8000 poste 2059
> Fax: 1-819-821-8049
> ______________________________________________
> mailing list
> PLEASE do read the posting guide!

John Fox
Department of Sociology
McMaster University
Hamilton, Ontario, Canada mailing list PLEASE do read the posting guide! Received on Thu May 25 19:29:01 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 26 May 2006 - 00:10:21 EST.

Mailing list information is available at Please read the posting guide before posting to the list.