Skip to content

Multiple levelplot with title

3 messages · Richard O. Legendi, Carlos Ortega, Deepayan Sarkar

#
Hi all,

I'm new to R and to the mailing list, so please bear with me :-)

I would like to create multiple levelplots on the same chart with a nice 
main title with something like this:

   print(levelplot(matrix(c(1,2,3,4), 2, 2)), split=c(1, 1, 2, 1))
   print(levelplot(matrix(c(1,2,3,4), 2, 2)), split=c(2, 1, 2, 1),
         newpage=FALSE)

I found a trick:

   mtext("Test", outer = TRUE, cex = 1.5)

here:

   https://stat.ethz.ch/pipermail/r-help/2008-July/168163.html

but it doesn't works for me.

Could anyone please show me some pointers what should I read in order to 
get an insight why this isn't working as I expect?

What I managed to find a workaround by using panel.text(), but I don't 
really like it since it requires defined x/y coordinates and not scales 
if the picture is resized.

	panel.text(x=20, y=110, "Test")

Thanks in advance!
Richard
5 days later
#
On Sun, Oct 9, 2011 at 10:00 PM, Richard O. Legendi
<richard.legendi at gmail.com> wrote:
That part's easy: lattice is drawing using grid graphics, and mtext is
drawing using "traditional" graphics, and the two don't (easily) mix.

You will need to delve into grid a little bit for what you want. Do
you have a good reason to have separate levelplots? One of the main
points of lattice is to avoid such things.

-Deepayan