Skip to content

xyplot main title question

3 messages · Pogoda, Wendy, Dieter Menne, Deepayan Sarkar

#
Pogoda, Wendy <wpogoda <at> coba.usf.edu> writes:
....
How can I change the main title text size in the xyplot function? . 

This IS confusing. General rule: whenever you use a function from 
lattice/trellis, par(...) is the wrong way to go. Use trellis.par.get and 
trellis.par set instead.

library(lattice)

mt = trellis.par.get("par.main.text")
mt$cex = 0.7
# may also set other options, such as font.
trellis.par.set("par.main.text",mt)

xyplot(lat ~ long , data = quakes,
  main="This is a very long text This is a very long text ")

----
My way if lost in lattice:

trellis.par.get()

Copy the output you to a text file, and keep it on your disk. Whenever you want 
to set a graphics options, search that file for something that comes close, and 
use the above get/set. 
Don't forget to update the file on lattice updates, these settings change.
Use show.settings() helps sometimes, but it's not complete.

Dieter
#
On 9/25/05, Pogoda, Wendy <wpogoda at coba.usf.edu> wrote:
None that I know of (though you can specify the width and height when
starting a device).
xyplot( ... ,
       par.settings = list(par.main.text = list(cex = 0.7)))

Deepayan