An embedded and charset-unspecified text was scrubbed... Name: not available Url: https://stat.ethz.ch/pipermail/r-help/attachments/20050925/1c0ba227/attachment.pl
xyplot main title question
3 messages · Pogoda, Wendy, Dieter Menne, Deepayan Sarkar
Pogoda, Wendy <wpogoda <at> coba.usf.edu> writes:
When I use the xyplot function (lattice library) the titles are too long
....
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:
When I use the xyplot function (lattice library) the titles are too long (i.e. part of the title are cut off). This fixes if I maximize the plot, but I would like the user of the program to not have to manually maximize the plotting window. I have tried to shrink the main title by using the "par(cex.main=.7)" before the xyplot function, but it seems any prior par options are ignored by xyplot. There is an option inside xyplot called "par.settings", but I have been unable to figure out how to make it change the main title text size. So, there are 2 possible solutions to my problem: 1) if there a text command to maximize the graphing window, what is it? or
None that I know of (though you can specify the width and height when starting a device).
2) how can I change the main title text size in the xyplot function?
xyplot( ... ,
par.settings = list(par.main.text = list(cex = 0.7)))
Deepayan