Grabbing a single grob from a plot

4 views
Skip to first unread message

russ

unread,
Feb 19, 2009, 9:31:45 PM2/19/09
to ggplot2
Hi,

I am struggling with the idea of grabbing a single grob from the
complex gTree produced by ggplot.
I would like to grab just the panel gTree. I have not been able to
figure out how to specify gPath in
getGrob(grob,gPath(??)) command.

Thanks,

~Russ

hadley wickham

unread,
Feb 23, 2009, 9:54:07 AM2/23/09
to russ, ggplot2
Hi Russ,

Start by rendering the plot on screen and then using grid.ls(). The
grobs should have sufficiently unique names that you can use getGrob
with global = TRUE to find the one that you're looking for.

Hadley
--
http://had.co.nz/
Reply all
Reply to author
Forward
0 new messages