[R] Setting fontsize in dev.copy2eps

Peter Kleiweg kleiweg at let.rug.nl
Tue Jan 9 22:44:19 CET 2001


I have a figure on screen with a legend. I want to copy this
image to EPS, and use:

    dev.copy2eps(file="file1.eps", width=5, height=5) 

The legend that looks OK on screen doesn't look OK in the
PostScript image: the text extends out of the box.

I try adding a fontsize command:

    dev.copy2eps(file="file1.eps", width=5, height=5, pointsize=5)

This options seems to get ignored.

I try setting cex to a smaller value, replotting the figure, and
copying the result to EPS. Result: the font is smaller, but so
is the text. Legend text still expands outside the legend box.
    
All works well if I leave out the width and height arguments to
dev.copy2eps. But then, the figure gets too large, and scaling
down the figure to a reasonable size when including the figure
in a document, things like linewidth become to small.

The only way out of this as I see it (apart from not using
dev.copy2eps) is to enlarge all objects like linewidths,
fontsizes, etc. So, when the figure is scaled down (when
including it in a document, leaving it at its default size at
the moment of saving with dev.copy2eps), the linewidths and
fontsize come out OK. This seems a bit drastic. Is it even 
possible to resize all elements? For instance, can I enlarge
dashpatterns? Is there an easier solution?

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.

-- 
Peter Kleiweg
http://www.let.rug.nl/~kleiweg/

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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