[R] Setting fontsize in dev.copy2eps

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Jan 10 00:37:14 CET 2001


On Tue, 9 Jan 2001, Prof Brian Ripley wrote:

> Just plotting on a postscript() device?  The issue here is that dev.copy
> copies the display list, and that has been done with a particular
> pointsize.  It's a convenience, only.  You can set the pointsize, but it
> does nothing when re-plotting, as I understand it.
>
> > So, these are my problems:
> >
> > 1. I can't seem to set the fontsize with dev.copy2eps
> > 2. I don't really want to set the fontsize with
> >    dev.copy2eps. The fontsize is OK. The legend box is too
> >    small.
>
> That's a font metric mismatch, I think.

That's sometimes the problem (font metrics do differ by device
surprisingly much), but the basic problem is in legend. That computes the
text width and height and converts them to user coordinates, those in use
at the time legend() is run. Try resizing a plot with a legend on (as Ross
says he likes to do to fine-tune the layout). The text stays of fixed size
but the box changes size.

I think you do need to draw on a device at the target size to work around
this. That is what I have always done: reuse the plotting commands on a
postscript device, suitably tuned.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list