Hi All, I have been using R for a while but only recently tried to draw quality plots for publications. I spent a few days tried to figure out how to draw multiple plots on a single page to a postscript or pdf file but not successful. The drawing is perfect OK if it is displayed on the screen using x11() device. E.g. x11() par(mfrow=c(2,2)) par(mai=c(0.5,0.3, 0.6, 0.4)) plot(x, y, ..........) plot(x, z ...........) plot(z, y,...........) plot(z+x, x-y, .....) Four plots displayed on the screen when X-Win32 was set up. Please advice how can I save this to a postscript or PDF file or any kind of file for publication and powerpoint slide? Thank a lot.. Zach Hu Assistant Professor in Biology [[alternative HTML version deleted]]
Andrew Robinson
2004-Aug-05 02:03 UTC
[R] Drawing multiple plots on one page for publication.
Zach, try: pdf("Name.pdf") par(mfrow=c(2,2)) par(mai=c(0.5,0.3, 0.6, 0.4)) plot(x, y, ..........) plot(x, z ...........) plot(z, y,...........) plot(z+x, x-y, .....) dev.off() Andrew
Prof Brian Ripley
2004-Aug-05 05:28 UTC
[R] Drawing multiple plots on one page for publication.
On Wed, 4 Aug 2004, Zach Hu wrote:> I have been using R for a while but only recently tried to draw quality > plots for publications. I spent a few days tried to figure out how to > draw multiple plots on a single page to a postscript or pdf file but not > successful. The drawing is perfect OK if it is displayed on the screen > using x11() device. E.g. > > x11() > par(mfrow=c(2,2)) > par(mai=c(0.5,0.3, 0.6, 0.4)) > > plot(x, y, ..........) > plot(x, z ...........) > plot(z, y,...........) > plot(z+x, x-y, .....) > > Four plots displayed on the screen when X-Win32 was set up. Please > advice how can I save this to a postscript or PDF file or any kind of > file for publication and powerpoint slide?Just replace `x11()' by `postscript()' or `pdf()': you may want to set the width, height and pointsize suitably. [You can use dev.copy2eps to copy the screen, but for publication-quality plots should should replot on the desired end device to use the correct font metrics.] -- 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 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595