Produces a graphical display of (by default) the current grid scene,
with labels showing the names of each grob in the scene.
It is also possible to label only specific grobs in the scene.
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(grid)
> png(filename="/home/ddbj/snapshot/RGM3/R_rel/result/grid/showGrob.Rd_%03d_medium.png", width=480, height=480)
> ### Name: showGrob
> ### Title: Label grid grobs.
> ### Aliases: showGrob
> ### Keywords: dplot
>
> ### ** Examples
>
> grid.newpage()
> gt <- gTree(childrenvp=vpStack(
+ viewport(x=0, width=.5, just="left", name="vp"),
+ viewport(y=.5, height=.5, just="bottom", name="vp2")),
+ children=gList(rectGrob(vp="vp::vp2", name="child")),
+ name="parent")
> grid.draw(gt)
> showGrob()
> showGrob(gPath="child")
> showGrob(recurse=FALSE)
> showGrob(depth=1)
> showGrob(depth=2)
> showGrob(depth=1:2)
> showGrob(gt)
> showGrob(gt, gPath="child")
> showGrob(just="left", gp=gpar(col="red", cex=.5), rot=45)
> showGrob(labelfun=function(grob, ...) {
+ x <- grobX(grob, "west")
+ y <- grobY(grob, "north")
+ gTree(children=gList(rectGrob(x=x, y=y,
+ width=stringWidth(grob$name) + unit(2, "mm"),
+ height=stringHeight(grob$name) + unit(2, "mm"),
+ gp=gpar(col=NA, fill=rgb(1, 0, 0, .5)),
+ just=c("left", "top")),
+ textGrob(grob$name,
+ x=x + unit(1, "mm"), y=y - unit(1, "mm"),
+ just=c("left", "top"))))
+ })
>
> ## Not run:
> ##D # Examples from higher-level packages
> ##D
> ##D library(lattice)
> ##D # Ctrl-c after first example
> ##D example(histogram)
> ##D showGrob()
> ##D showGrob(gPath="plot_01.ylab")
> ##D
> ##D library(ggplot2)
> ##D # Ctrl-c after first example
> ##D example(qplot)
> ##D showGrob()
> ##D showGrob(recurse=FALSE)
> ##D showGrob(gPath="panel-3-3")
> ##D showGrob(gPath="axis.title", grep=TRUE)
> ##D showGrob(depth=2)
> ## End(Not run)
>
>
>
>
>
> dev.off()
null device
1
>