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 2) how can I change the main title text size in the xyplot function? . I would appreciate any help. Thanks so much! [[alternative HTML version deleted]]
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? orNone 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