[R] lattice: how to "center" a title?

Marius Hofert m_hofert at web.de
Tue Jan 4 10:53:33 CET 2011


Dear expeRts,

As you can see from this example...

trellis.device("pdf", width = 5, height = 5)
  print(xyplot(0 ~ 0, main = "This title is not 'centered' for the human's eye", scales = list(alternating = c(1,1), tck = c(1,0))))
dev.off()

... the title does not seem to be "centered" for the human's eye [although it is centered when the plot (width) is considered with the y-axis label]. 
I could not easily (via trellis.par.get()) find a way to adjust this. Of course one could include more spaces in the title string, but is there a more elegant way to slightly shift the title to the right? 

Cheers,

Marius


More information about the R-help mailing list