search for: stringheight

Displaying 7 results from an estimated 7 matches for "stringheight".

2011 Apr 26
2
grid stringHeight
Dear all, I'm puzzled by the behavior of stringHeight in the grid package. Consider the following test, library(grid) test <- function(lab="dog", ...){ g1 <- textGrob(lab) g2 <- rectGrob(height=grobHeight(g1), width=grobWidth(g1)) gg <- gTree(children=gList(g1,g2), ...) print(c("height:", convertUnit(stringHe...
2011 Oct 25
1
R fails when converting units using Hershey-Fonts
I run into some problems when trying to convert units using Hershey-Fonts: R chrashes. > library(grid) > label <- "some text" > pushViewport(viewport(gp=gpar(fontfamily="HersheySerif"))) > convertHeight(stringHeight(label), unitTo="mm") *** caught segfault *** address 0xadc838f8, cause 'memory not mapped' Traceback: 1: .Call(fnname, ..., PACKAGE = "grid") 2: grid.Call("L_convert", x, as.integer(whatfrom), as.integer(whatto), valid.units(unitTo)) 3:...
2005 Jun 22
1
legend
I color some area grey with polygon() (with a red border) and then I want to have the dashed red border in the legend as well. How do I manage it? And I want to mix (latex) expressions with text in my legend. Just execute my lines below and you know want I mean. Or pass by at http://de.wikipedia.org/wiki/Bild:GBM.png to see the picture online. Thomas bm <- function(n=500, from=0, to=1) {
2005 Jun 02
0
Thanks! (was panel.axis() & grid/lattice settings)
...gt; > Paul may be able to give a more insightful answer, but grid > allows a string to > > determine it's width in terms of itself, e.g.: > > > > unit(1, "strwidth", data = "foo") > > > Or just stringWidth("foo") (and of course stringHeight("foo")). > > > > If you want to convert that into, say, inches, you could use > > > > > >>convertX(unit(1, "strwidth", data = "foo"), "inches", TRUE) > > > > [1] 0.2344092 > > > > I think this wo...
2009 Sep 19
1
matrix operations on grobs and grid units
...to find a clean and efficient way to arrange text grobs in a rectangular layout. The labels may be expressions, or text with a fontsize different of the default, which means that the cell sizes should probably be calculated using grobWidth() and grobHeight() as opposed to simpler stringWidth() and stringHeight(). (Correct?). The input of this function is a vector of labels, which are arranged into a matrix layout. Below is my current version, followed by a few questions. e = expression(alpha,"testing very large width", hat(beta), integral(f(x)*dx, a, b)) rowMax.units <- function(u, nrow){...
2004 Apr 12
1
R 1.9.0 is release
...ifying grob objects: grid.add(), grid.remove(), grid.edit(), grid.get() (and their *Grob() counterparts can be used to add, remove, edit, or extract a grob or the child of a gTree. NOTE: the new grid.edit() API is incompatible with the previous version. - Added stringWidth(), stringHeight(), grobWidth(), and grobHeight() convenience functions (they produce "strwidth", "strheight", "grobwidth", and "grobheight" unit objects, respectively). - Allowed viewports to turn off clipping altogether. Possible settings for viewport clip arg ar...
2004 Apr 12
1
R 1.9.0 is release
...ifying grob objects: grid.add(), grid.remove(), grid.edit(), grid.get() (and their *Grob() counterparts can be used to add, remove, edit, or extract a grob or the child of a gTree. NOTE: the new grid.edit() API is incompatible with the previous version. - Added stringWidth(), stringHeight(), grobWidth(), and grobHeight() convenience functions (they produce "strwidth", "strheight", "grobwidth", and "grobheight" unit objects, respectively). - Allowed viewports to turn off clipping altogether. Possible settings for viewport clip arg ar...