[R] grob questions

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Mon 03 Oct 2005 - 15:37:54 EST


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)
> grid.edit("myplot::xaxis", at = 1:10/11)
> grid.edit("myplot::xaxis::labels", label = round(1:10/11, 2))
> grid.edit("myplot::xaxis::labels", y = unit(-1, "lines"))

then

> str(myplot$children$xaxis)

lists 'at' but not the 'labels'.

yet if I do this then the labels are listed:

> xx <- xaxisGrob(name = "myX", at = 1:10)
> childNames(xx)

[1] "major" "ticks" "labels"

  1. How do I get to labels in the first case?
  2. Is there a better construct than myplot$children$xaxis?

Thanks.



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Mon Oct 03 15:43:11 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:40:34 EST