Re: [Rd] grid stringHeight

2011-05-01 Thread baptiste auguie
Hi, I see, thanks. I incorrectly thought it used to produce the same output in the past. As a workaround I will wrap all strings in expression() before evaluating the grobHeight; otherwise the calculated layout can clip portions of the text. Thanks, baptiste On 2 May 2011 15:00, Paul Murrell w

Re: [Rd] grid stringHeight

2011-05-01 Thread Paul Murrell
Hi This is a basic "feature" of both strheight() and stringHeight(). They both ignore any descenders in the text. I cannot remember why it was done this way originally. The future solution is probably to add an argument that allows descenders to be included in text height. Plotmath works

Re: [Rd] grid stringHeight

2011-04-29 Thread baptiste auguie
On 27 April 2011 11:06, baptiste auguie wrote: > 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)

[Rd] grid stringHeight

2011-04-26 Thread baptiste auguie
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: