Displaying 2 results from an estimated 2 matches for "packgrob".
2009 Sep 20
1
packGrob and dynamic resizing
...Tables of Text Using grid
Paul Murrell
July 9, 2003
As a minimal example, I wrote this,
gf <- grid.frame(layout = grid.layout(1, 1), draw = TRUE)
label1 <- textGrob("test", x = 0, just = "left", name="test")
gf=placeGrob(gf, rectGrob(), row = 1, col = 1)
gf=packGrob(gf, label1, row = 1, col = 1)
grid.draw(gf)
grid.edit("test", label = "longer text", grep=T)
I'm a bit lost here, as I was expecting the frame to be automatically
adjusted to fit the new text.
Can anyone point me in the right direction?
Best regards,
baptiste
2009 Oct 23
1
Distance between axis and label adjusted automatically?
...rection. So there is no
universal estimation that looks good in all cases -- of course I
can provide a "safety margin", but it looks stupid when there is
too much space between label and axis.
I tried to use the relative positioning mechanism of frames,
roughly like this:
fb <- packGrob(fg,yaxisGrob(vp="dataRegion"),side="left")
fg <- packGrob(fg,textGrob("y axis label",rot=90),side="left")
But it appears that the true size of the axis is not respected;
numbers on the axis and the label still may overlap.
Can anyone provide a simple...