[R] Postscript File Size

Prof Brian Ripley ripley at stats.ox.ac.uk
Fri Feb 23 17:09:15 CET 2001

> Date: Fri, 23 Feb 2001 07:41:21 -0800 (PST)
> From: "Jacob W. Bowers" <jbowers at csm.berkeley.edu>
> To: R-help at stat.math.ethz.ch
> Subject: [R] Postscript File Size
> Hi.
> Is there any way to reduce the size of postscript output from R?
> I have just discovered that the same plot done on Splus 5.1 (on Solaris)
> is about 900k compared to roughly 6.6mb on R-1.2.0 (on Solaris).

It is I suspect because you are using pch-".", which is special-cased
in the R code to be a small square, not an ASCII symbol, and so uses
quite a lot of space, a line like

106.49 114.85 107.49 115.85 r p2

S-PLUS uses 1/4 as much, in part because it rounds coords to the nearest
big point.  I cannot reproduce a factor of over 7.

> I produced this plot the same way on both platforms (except for "font=3"
> on Splus and "family="Times"" on R):
> .plot plot plot (lots of points (pch="."), roughly 30,000 per plot * 9
> plots)....
> dev.off()
> I also tried using "dev.copy2eps()" on R, but that didn't change the size
> of the resulting file.

(It would not: it just generates a call to postscript().)

> I'd hate to email a such a huge file.
> Any thoughts about what to do?

Why does it matter?   You might want select fewer than 30,000 points to plot,
as you must have a large mass of black toner on your page.

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