[R] Using pointsize with postscript trellis.device

Deepayan Sarkar deepayan at stat.wisc.edu
Wed May 19 02:35:37 CEST 2004


On Tuesday 18 May 2004 17:10, Patrick Connolly wrote:
> I've been accustomed to specifying a postscript file and pointsize
> like so:
>
> trellis.device(postscript, file = "something.ps", pointsize = 8)
>
> Using version
>          _
> platform i686-pc-linux-gnu
> arch     i686
> os       linux-gnu
> system   i686, linux-gnu
> status
> major    1
> minor    9.0
> year     2004
> month    04
> day      12
> language R     ,
>
> the pointsize does not seem to have any effect (i.e. the default
> pointsize is still at 12).  I tried specifically setting pointsize as
> a ps.option, but also to no avail.
>
> The same idea works with regular plots and I'm sure I used to be able
> to do this with previous versions with lattice plots also.

This is an issue which is still somewhat open. I know why this doesn't 
work, but I'm not sure if it's the best way to handle things and I'm 
open to suggestions.

The size of various grid components are controlled by the grid gpar 
`fontsize', which seems to default to the pointsize of the device (I'm 
not sure if this is documented). The problem is that while the default 
of 12 is OK for text, it seems too big for points. Also, it probably 
makes sense to have this as a lattice setting, and not a par() value 
(although this is debatable).

So, right now this is controlled by 
> trellis.par.get("fontsize")
$text
[1] 12

$points
[1] 8

which is supposed to be used for text and points respectively. In 
practice, the "text" component is only used as the default when setting 
up the main viewport, and the "points" component is used individually 
by any functions that draw points.

You could probably get what you want with something like

trellis.device(postscript, file = "something.ps", 
               theme = list(fontsize = 
               list(text = 8, points = 6)))

Deepayan




More information about the R-help mailing list