Displaying 3 results from an estimated 3 matches for "getgrob".
Did you mean:
setgrob
2009 May 31
2
grid.edit() for ggplot2
...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
2009 Sep 27
0
puzzle with drawDetails for a class derived from a gTree
...its)
## create the two grobs
left <- make.test.left(x$left, x$col)
right <- make.test.right(x$right, x$col)
## add them to the gTree
x <- addGrob(x, right)
x <- addGrob(x, left)
## borrowed from grid.xaxis
## draw the children only
for(child in childNames(x))
grid.draw(getGrob(x, child))
}
grid.test("a", "b", edits=gEdit(left="left text", col="blue"), name="test")
# works as expected
grid.newpage()
grid.test(left="left text", right="right text", name="test")
grid.edit("test"...
2005 Oct 03
2
grob questions
If I run the following example from:
http://www.stat.auckland.ac.nz/~paul/grid/doc/grobs.pdf
> grid.newpage()
> pushViewport(viewport(w = 0.5, h = 0.5))
> myplot <- gTree(name = "myplot", children = gList(rectGrob(name = "box",
+ gp = gpar(col = "grey")), xaxisGrob(name = "xaxis")))
> grid.draw(myplot)
>