[R] Windows metafiles from lattice plots

Sundar Dorai-Raj sundar.dorai-raj at pdf.com
Sun Apr 27 16:00:41 CEST 2003

Tautz, Art WLAP:EX wrote:
> Could  someone please tell me if it is possible to automate the production
> of a series of windows metafiles for each page of a multipage trellis plot?
> The problem is  that I have a number of conditioned plots, each  consisting
> of 1-30 individual conditioned regressions for each of 20-30 subsets of a
> factor. The graphics work as expected, with each page consistent with the
> layout specified for each factor.   However, if I attempt to automate the
> creation  of a wmf for each page, I only get a portion of the output. 
> Any help would be greatly appreciated 
> Art Tautz

How about this?


dframe <- data.frame(y = rnorm(100),
                      x = rnorm(100),
                      g = rep(1:4, 25))
win.metafile(width = 10,
              height = 7.5,
              file = "rplot%02d.wmf")
print(xyplot(y ~ x | g,
              data = dframe,
              layout = c(1, 1)))


More information about the R-help mailing list