[R] ggplot2: Changes to grobs not saved to file output
hadley wickham
h.wickham at gmail.com
Fri Sep 5 16:50:14 CEST 2008
Unfortunately it's not particularly easy in the current version. In
the next version, you can do:
p <- qplot(wt, mpg, data=mtcars, colour=cyl)
# Get the plot grob
grob <- ggplotGrob(p)
# Modify it place
grob <- geditGrob(grob, gPath("strip","label"), gp=gpar(fontface="bold"))
# Draw it
pdf(...)
grid.newpage()
grid.draw(grob)
dev.off()
I think in the current version you can do
qplot(wt, mpg, data=mtcars, colour=cyl)
grob <- grid.grab()
and then follow the remaining steps.
Regards,
Hadley
On Fri, Aug 29, 2008 at 8:58 AM, btcruiser <brian_teravskis at cargill.com> wrote:
>
> Hello,
>
> Maybe I missed something - most likely .:-(
>
> I create a gplot and then makes some changes to the plot using grid graphics
> functions. These changes show up on the display OK, but when I save using
> ggsave() the grid changes do not show up. How do I save the plot with these
> changes?
>
> Thanks in advance.
> --
> View this message in context: http://www.nabble.com/ggplot2%3A-Changes-to-grobs-not-saved-to-file-output-tp19220492p19220492.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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.
>
--
http://had.co.nz/
More information about the R-help
mailing list