[R] Multiple cex sizes in main for xyplot?

Bert Gunter gunter.berton at gene.com
Thu Apr 29 00:06:10 CEST 2010


Folks:

I would like to write two lines of text in two different font sizes (or
faces or ...) as the title ("main") of a trellis plot.  The following code
does it, but not well:

xyplot((0:1)~(0:1),
	main = textGrob(lab=c("Some Text","Some More Text"),y=c(.95,.8),
			gp=gpar(cex=c(1.2,1.0)))
	)

There is too much space between the title text and the plot. I assume that
can be fixed by fooling with padding settings in lattice.options(), but my
question is: Is there a better, simpler way to do this? 
Would using grid graphics directly by pushing title and plot viewports and
then adding the lattice graph to the plot viewport be a better way to go?

OS = Windows XP
R = 2.11.0 
lattice_0.18-3
device = windows

 
Bert Gunter
Genentech Nonclinical Biostatistics
 
 



More information about the R-help mailing list