[R] saving a plot to a file

Ko-Kang Kevin Wang Ko-Kang at xtra.co.nz
Mon Mar 3 19:25:03 CET 2003


Hi,

----- Original Message -----
From: "Rajarshi Guha" <rajarshi at presidency.com>
To: <r-help at stat.math.ethz.ch>
Sent: Tuesday, March 04, 2003 6:03 AM
Subject: [R] saving a plot to a file


> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
>   I'm a new user of R and have managed to make a plot of a histogram. Is
there
> any way I set the title and axes labels and then save the plot as an image
> (png/gif)?


To set the title/axis labels, one of the options is to use the main, xlab,
ylab parameters in hist().

For example:
    > hist(1:10, main = "A Histogram", xlab = "FOO", ylab = "Fred")

As for save the plot, take a look at:
    > ?png

Cheers,

Kevin

------------------------------------------------
Ko-Kang Kevin Wang
Master of Science (MSc) Student
Department of Statistics
University of Auckland
New Zealand
www.stat.auckland.ac.nz/~kwan022




More information about the R-help mailing list