Skip to content
Prev 65646 / 398506 Next

Lattice device page options-margins

Hi
Sundar Dorai-Raj wrote:
Or if you want exactly 0.5 inches, something like ...

# may need
# library(grid)
trellis.device(device = "pdf",file = "Figure6.pdf",color = FALSE)
xy <- xyplot(1:10 ~ 1:10)
pushViewport(viewport(x=1,
                       width=unit(1, "npc") - unit(0.5, "inches"),
                       just="right"))
# to show region you're plotting in
# grid.rect(gp=gpar(col="grey"))
print(xy, newpage=FALSE)
popViewport()
dev.off()

Paul