Skip to content
Prev 256371 / 398502 Next

Adding margin text to lattice graphics

Hi,

You may want to read about ?viewport in the grid package. They allow
you to position graphical elements wherever you want on a page, such
as lattice plots and text (grid.text). For a high-level interface, you
could try the following,


library(gridExtra)
library(lattice)

p1 = xyplot(1~1)
p2 = levelplot(volcano)
p3 = tableGrob(head(mpg[, 1:3]))
p4 = textGrob("some text")

grid.arrange(p1, p2, p3, p4, main="global page title",
                    sub=p4, left="page y-label")

HTH,
baptiste
On 10 April 2011 13:33, Dennis Fisher <fisher at plessthan.com> wrote: