Dear all,

I'm trying to access and modify grobs in a ggplot2 plot. The basic idea for raw Grid objects I understand from Paul Murrell's R graphics book, or this page of examples,

http://www.stat.auckland.ac.nz/~paul/grid/copygrob/copygrobs.R

However I can't figure out how to apply this to a ggplot (basically I don't know how to write a syntactically correct gPath),


p <- # minimal example
qplot(0,0)+ annotate("text",0,0,label="test")

g <- # store the plot as a grob
ggplotGrob(p)

# structure of the grob
grid.ls(g) # rather large!

# find a particular grob in the gTree
getGrob(g,"texts", grep = T)


# next step, modify, say, the colour of these grobs
grid.edit() # what do I put in here?


Thanks for any piece of advice,

baptiste

______________________________________________
R-help@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.

Reply via email to