Skip to content

ggplot2: Changes to grobs not saved to file output

1 message · Hadley Wickham

#
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: