[R] Lattice xyplot -- footnote font size / mtext

Deepayan Sarkar deepayan at stat.wisc.edu
Fri Jun 3 23:15:41 CEST 2005


On Friday 03 June 2005 15:47, Kittler, Richard wrote:
> Is there a way of controlling the font size and alignment of a footnote
> in an xyplot, or alternatively of using 'mtext' to place a footnote at
> the bottom of a graph?

Your best bet is using 'page', e.g.

library(grid)
library(lattice)
xyplot(1 ~ 1, 
       page = function(n) 
           grid.text(paste("footnote for page", n), 
                     x = .99, y = 0.01, 
                     default.units = "npc", 
                     just = c("right", "bottom")))

You could also use panel.text instead of grid.text, but the latter is more 
flexible. You could make the font smaller by adding the following in the 
grid.text call:

gp = gpar(fontsize = 8)

Deepayan




More information about the R-help mailing list