Re: [R] Grid unit width and font face

2011-08-14 Thread Paul Murrell
Hi On 8/13/2011 9:49 AM, Prof Brian Ripley wrote: I think you are doing this in the wrong order. You need to set the gpar on the viewport, then compute the grid.rect. grid.rect(width=unit(1,'strwidth','Some text'),draw=T, gp=gpar(font=2)) grid.text('Some text',y=0.4,gp=gpar(font=2),draw=T) i

Re: [R] Grid unit width and font face

2011-08-12 Thread Prof Brian Ripley
I think you are doing this in the wrong order. You need to set the gpar on the viewport, then compute the grid.rect. grid.rect(width=unit(1,'strwidth','Some text'),draw=T, gp=gpar(font=2)) grid.text('Some text',y=0.4,gp=gpar(font=2),draw=T) is one way to do it: pushing a viewport is another.

[R] Grid unit width and font face

2011-08-12 Thread Sébastien Bihorel
Dear R-users, When one defines a grid unit object using the 'strwidth' dimension, it seems that the default plain font is assumed as the following example illustrates. Is there a way to either make use of a font option when creating a unit object or to know the factor that exists between the width