[R] Controlling graphics parameters in lattice
Michael Friendly
friendly at yorku.ca
Fri Dec 6 17:38:03 CET 2002
I'm just starting to work with lattice graphics, and am
having difficulty understanding how to control various graphic
parameters (font sizes, etc.). [I'm actually using xyplot
via plot.effect() in the car package, and would like to be
able to set some global defaults.]
I read ?xyplot and ?trellis.par.set-- which contains no complete
list of parameters, just a reference to print(trellis.par.get())
> print(trellis.par.get())
$fontsize
$fontsize$default
[1] 10
I tried
> trellis.par.set("fontsize", 12)
> data(quakes)
> Depth <- equal.count(quakes$depth, number=8, overlap=.1)
> xyplot(lat ~ long | Depth, data = quakes)
And this crashes the Rgui (Windows, R 1.6.1). Is this a buglet
or did I do something wrong?
I then tried
> xyplot(lat ~ long | Depth, data = quakes, scales=list(cex=1.5))
which makes the tick labels larger, but not the axis labels.
As well, I'm confused about why the following has no effect
on the background (from a fresh start):
> library(lattice)
> trellis.par.set("background", "white")
> data(quakes)
> Depth <- equal.count(quakes$depth, number=8, overlap=.1)
> xyplot(lat ~ long | Depth, data = quakes)
Only after I've run xyplot once, I can repeat
> trellis.par.set("background", "white")
> xyplot(lat ~ long | Depth, data = quakes)
and the background will change.
thanks,
-Michael
--
Michael Friendly friendly at yorku.ca
York University http://www.math.yorku.ca/SCS/friendly.html
Psychology Department
4700 Keele Street Tel: (416) 736-5115 x66249
Toronto, Ontario, M3J 1P3 Fax: (416) 736-5814
More information about the R-help
mailing list