Hi! You may try (from the R help): dev.print(postscript, file = "some_name.eps", horizontal = FALSE, onefile = FALSE, paper = "special") On Tue, 27 May 2003, Rishabh Gupta wrote:> Dear all, > > I am trying to create eps files of R plots (in Linux) so that I can import them into Word > (obviously in MS Windows). What I would like is for the files to be cropped so that there is no > margin around the actual plot, because I have no way of editing the files after they have been > created. I have tried using > > par(mai=c(.75,.75,0,0)) > > in order to reduce the margin; it works fine when I create a plot on the screen, however when I > use > > dev.copy2eps(file="FILENAME.eps") > > to save to the eps file, the margin has returned. Could someone please tell what I am doing wrong, > should I be using different parameter to set the margins of the eps files. > > Any help would be greatly appreciated. > > Many Thanks > > Rishabh > > __________________________________________________ > It's Samaritans' Week. Help Samaritans help others. > Call 08709 000032 to give or donate online now at http://www.samaritans.org/support/donations.shtm > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help >-- Ulises M. Alvarez LAB. DE ONDAS DE CHOQUE FISICA APLICADA Y TECNOLOGIA AVANZADA UNAM umalvarez at fata.unam.mx
Dear all, I am trying to create eps files of R plots (in Linux) so that I can import them into Word (obviously in MS Windows). What I would like is for the files to be cropped so that there is no margin around the actual plot, because I have no way of editing the files after they have been created. I have tried using par(mai=c(.75,.75,0,0)) in order to reduce the margin; it works fine when I create a plot on the screen, however when I use dev.copy2eps(file="FILENAME.eps") to save to the eps file, the margin has returned. Could someone please tell what I am doing wrong, should I be using different parameter to set the margins of the eps files. Any help would be greatly appreciated. Many Thanks Rishabh __________________________________________________ It's Samaritans' Week. Help Samaritans help others. Call 08709 000032 to give or donate online now at http://www.samaritans.org/support/donations.shtm
On Tue, 27 May 2003 20:33:05 +0100 (BST), you wrote in message <20030527193305.52325.qmail at web41101.mail.yahoo.com>:>Dear all, > >I am trying to create eps files of R plots (in Linux) so that I can import them into Word >(obviously in MS Windows). What I would like is for the files to be cropped so that there is no >margin around the actual plot, because I have no way of editing the files after they have been >created. I have tried using > >par(mai=c(.75,.75,0,0)) > >in order to reduce the margin; it works fine when I create a plot on the screen, however when I >use > >dev.copy2eps(file="FILENAME.eps") > >to save to the eps file, the margin has returned. Could someone please tell what I am doing wrong, >should I be using different parameter to set the margins of the eps files. > >Any help would be greatly appreciated.I think the easiest way to do this is to use Ghostview to "convert to EPS", and have it recalculate the bounding box as it does so. Since it's working with a Postscript interpreter, it does the bounding box calculation very accurately; playing around with margins is likely to lead to inconsistencies depending on labels, etc. Duncan Murdoch
Hi, Thanks to everyone that replied. It seems that the solution was simpler than I thought. I was using the wrong parameter. It should have been par( mar = c( .., .., .., ..) ) rather than par( mai = c( .., .., .., ..) ) After I changed that it works fine now. Thanks Rishabh --- Rishabh Gupta <rg117 at yahoo.co.uk> wrote: > Dear all,> > I am trying to create eps files of R plots (in Linux) so that I can import them into Word > (obviously in MS Windows). What I would like is for the files to be cropped so that there is no > margin around the actual plot, because I have no way of editing the files after they have been > created. I have tried using > > par(mai=c(.75,.75,0,0)) > > in order to reduce the margin; it works fine when I create a plot on the screen, however when I > use > > dev.copy2eps(file="FILENAME.eps") > > to save to the eps file, the margin has returned. Could someone please tell what I am doing > wrong, > should I be using different parameter to set the margins of the eps files. > > Any help would be greatly appreciated. > > Many Thanks > > Rishabh > > __________________________________________________ > It's Samaritans' Week. Help Samaritans help others. > Call 08709 000032 to give or donate online now at > http://www.samaritans.org/support/donations.shtm > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help__________________________________________________ http://uk.promotions.yahoo.com/yplus/yoffer.html