Displaying 7 results from an estimated 7 matches for "childname".
Did you mean:
childnames
2008 Jul 09
1
childNames for xaxis grob (grid package)
Dear list,
Can someone explain why the childNames below
gives
character(0)
instead of the (canonical) names of the children grobs
of the xaxis gTree ?
[1] "major" "ticks" "labels"
Many thanks in advance,
Tobias
### minimal example code ###
library(grid)
pushViewport(plotViewport(c(5,4,4,2)))
pushViewport(data...
2005 Oct 03
2
grob questions
...und(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.
2006 Feb 23
3
has_many: inserting children when inserting parent
...39;childlist'', ''names'' %>
Now the ParentController and its create method which I would like to
save both the parent and all its childeren:
class ParentsController < ApplicationController
def create
@parent = Parent.new(params[:parent])
@parent.save
childnames = params[:childlist][:names]
childname.split(/\s+/).each do |name|
child = Child.new({ :parent_id => @parent.id, :name => name})
child.save
@parent.children << child
end
redirect_to :action => ''list''
end
Is this the right approach? A...
2009 Sep 27
0
puzzle with drawDetails for a class derived from a gTree
...x <- applyEdits(x, x$edits)
## 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")...
2006 Jul 29
3
placing rectangle behind plot
I am trying to create a lattice plot and would like to later, i.e. after
the plot is drawn, add a grey rectangle behind a portion of it.
The following works except that the rectrangle is on top of and
obscures a portion of the chart. I also tried adding col = "transparent"
to the gpar list but that did not help -- I am on windows and
perhaps the windows device does not support
2004 Oct 04
7
R 2.0.0 is released
...example ...
grid.rect(height=unit(4, "char")) # cex = 1
pushViewport(viewport(gp=gpar(cex=0.5)))
grid.rect(height=unit(4, "char")) # cex = 0.5
pushViewport(viewport(gp=gpar(cex=0.5)))
grid.rect(height=unit(4, "char")) # cex = 0.125 !!!
- New childNames() function to list the names of children
of a gTree.
- The "grep" and "global" arguments have been implemented for
grid.[add|edit|get|remove]Grob() functions.
The "grep" argument has also been implemented for the
grid.set() and setGrob().
- New functi...
2004 Oct 04
7
R 2.0.0 is released
...example ...
grid.rect(height=unit(4, "char")) # cex = 1
pushViewport(viewport(gp=gpar(cex=0.5)))
grid.rect(height=unit(4, "char")) # cex = 0.5
pushViewport(viewport(gp=gpar(cex=0.5)))
grid.rect(height=unit(4, "char")) # cex = 0.125 !!!
- New childNames() function to list the names of children
of a gTree.
- The "grep" and "global" arguments have been implemented for
grid.[add|edit|get|remove]Grob() functions.
The "grep" argument has also been implemented for the
grid.set() and setGrob().
- New functi...