[R] Chart Size

Prof Brian Ripley ripley at stats.ox.ac.uk
Fri Mar 30 11:34:42 CEST 2001


On Fri, 30 Mar 2001, Bill Simpson wrote:

> > How do I change the size of the chart, please?
> Do you mean the version you save to disk or print out? Or the version you
> see on the screen?
>
> I'm not sure about the screen. To print the current plot
> dev.print(height=6, width=6, horizontal=FALSE)
> Vary the height and width to suit your taste.
> You might want to include pointsize=20 or whatever so the text is in
> proper proportion to the rest of your plot. (Unfortunately this will also
> make the hash marks too big and put a big gap between the axis labels and
> the axis title like this
>
> ----+----+----+----+----+---
>     |    |    |    |    |
>     |    |    |    |    |
>
>
>     1    2    3    4    5

The problem is your use of dev.print here: the ticks change but not the
text size.  dev.copy does not use the new pointsize: try

x11(width=3, height=3, pointsize=8)
x11(width=6, height=6, pointsize=16)
dev.set(2)
plot(1:10)
dev.copy()

Re-scaling works as expected for new plots but not re-played plots.
Plotting directly on a bigger device is that answer: plots then scale
exactly, except for perhaps default line widths and other things where
rasterization effects come into play.  In short, if you want postscript,
use postscript() directly.

dev.copy in this respect differs from S-PLUS, but I have always assumed it
was deliberate as calculating things like plotmath have to be done at
a known font size.

The rescaling of a windows() device works differently, and does rescale
the fonts.

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