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

From: P Ehlers <ehlers_at_math.ucalgary.ca>
Date: Thu 25 May 2006 - 22:22:22 EST

John Fox wrote:

> 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,
> John

Possibly a bit more efficient:

trellis.par.set(list(axis.text = list(cex = 2),
                      par.ylab.text = list(cex = 1.5),
                      par.xlab.text = list(cex = 0.5)))

Also good to know, Emilie:

   trellis.par.get()

to see all the things that can be (re)set. Most are self-explanatory.

>
> On Wed, 24 May 2006 13:24:03 -0400
> Emilie Berthiaume <Emilie.Berthiaume@usherbrooke.ca> 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
>>J1K 2R1 CANADA
>>
>>Phone: 1-819-821-8000 poste 2059
>>Fax: 1-819-821-8049
>>emilie.berthiaume@USherbrooke.ca
>>
>>______________________________________________
>>R-help@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

>
>
> --------------------------------
> John Fox
> Department of Sociology
> McMaster University
> Hamilton, Ontario, Canada
> http://socserv.mcmaster.ca/jfox/
>
> ______________________________________________
> R-help@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


R-help@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 Received on Thu May 25 22:26:34 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 - 20:10:18 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.