[R] Print grid/ggplot to a metafile

Dieter Menne dieter.menne at menne-biomed.de
Fri Jun 29 21:48:25 CEST 2007

Dear UseRs called Hadley, or Paul,

I am trying to print an edited ggplot2/grid graphics to a metafile. With the
commented line below it works, but when I edit the plot by uncommenting the
line, it fails, because it's illegal to have 2 graphics in a metafile. It
works with pdf, but even then I get two plots, which is a nuisance.

I found a workaround by using windows(); savePlot, but it only works in
interactive mode, not when called with something like (Windows)

rterm --no-save < printit.r

Any ideas?


mtcars$cyls = factor(mtcars$cyl,
ggplot(mtcars, aes(x=cyls)) + geom_bar()

More information about the R-help mailing list