[R] Saving lattice plot as a PDF

From: Judith Flores <juryef_at_yahoo.com>
Date: Sun, 9 Dec 2007 13:59:50 -0800 (PST)


Hi there,

    I need to save a series of lattice plots as a PDF, this is my code so far:

windows(height=8,width=6)
plot.new()
library('grid')
lattice.options(layout.heights=list(top.padding=list(x=0.15, units="inches")))

print(plot1, split=c(1,1,2,3), more=TRUE)
print(plot2, split=c(1,2,2,3), more=TRUE)
print(plot3, split=c(1,3,2,3), more=TRUE)
print(plot4, split=c(2,1,2,3), more=TRUE)
print(plot5, split=c(2,2,2,3), more=TRUE)
print(plot6, split=c(2,3,2,3), more=FALSE)

ltext(grid.locator(), label='text', cex=1.3) ltext(grid.locator(), label='text', cex=1.3)

And when I open the PDF created I see "text" at the bottom of may layout, even though I placed it at the top of the sheet.. If I save it as a metafile of PNG the layoout is correct.

I have tried trellis.devices, what do I need to do to retain the laout properties in a PDF format?

Thank you,

Judith



Looking for last minute shopping deals?

R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sun 09 Dec 2007 - 22:07:34 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 10 Dec 2007 - 00:30:18 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.