Hi, I have found references for the following problem in the list archives, but no nice solution. So I decided to post one I came up with. The problem is that graphs output as eps files, for example using ps.options(onefile=FALSE, paper="special", width=8, height=8, horizontal=FALSE, pointsize=12) get rotated when I convert them to pdf using epstopdf. Both ghostview and acroread display them rotated, so I don't think it's an actual acroread bug. I am using R 1.8.1. The solution is to "distill" the files using eps2eps, part of ghostscript on my Debian box. Here is an example Makefile I use for this: ---- cut here ---- EPS2EPS=eps2eps EPSTOPDF=epstopdf all: graph1.pdf graph2.pdf %.pdf: %.raweps $(EPS2EPS) $< $*.eps $(EPSTOPDF) $*.eps ---- cut here ---- So I have a fix now, and it works. But I still think that either the postscript() function in R, or both acroread and gs are broken. I know no ps/pdf, so I can't decide which, but in the long run, somebody with some ps/pdf expertise and a bit of time could look at this problem. Best, Tamas -- Tam??s K. Papp E-mail: tpapp at axelero.hu Please try to send only (latin-2) plain text, not HTML or other garbage.
The problem is simply that you are using epstopdf incorrectly. This is not an R issue but the correct solution has been discussed here before (although my quick searches failed to locate it in the archives). First, if you want `PDF graphs' you can make them in R with the pdf() device. I am very surprised you did not mention that. Second, if you insist on using distiller or gs (via epstopdf) you need to unset the option that rotates plots automatically. It's documented in ps2pdf.htm: By default Ghostscript determines viewing page orientation based on the dominant text orientation on the page. Sometimes, when the page has text in several orientations or has no text at all, wrong orientation can be selected. Acrobat Distiller parameter AutoRotatePages controls the automatic orientation selection algorithm. On Ghostscript, besides input stream, Distiller parameters can be given as command line arguments. For instance: -dAutoRotatePages=/None or /All or /PageByPage. You want /None. On Sat, 3 Apr 2004, Tamas Papp wrote:> I have found references for the following problem in the list > archives, but no nice solution. So I decided to post one I came up > with. > > The problem is that graphs output as eps files, for example using > > ps.options(onefile=FALSE, paper="special", width=8, height=8, > horizontal=FALSE, pointsize=12) > > get rotated when I convert them to pdf using epstopdf. Both ghostview > and acroread display them rotated, so I don't think it's an actual > acroread bug. I am using R 1.8.1.No, it's user error. You asked gs to rotate them. -- 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
The simplest solution for me is to set setenv GS_OPTIONS "-dAutoRotatePages=/None" There was a discussion on this topic a in October, but it was on R-devel. See here https://www.stat.math.ethz.ch/pipermail/r-devel/2003-October/027759.html -roger Tamas Papp wrote:> Hi, > > I have found references for the following problem in the list > archives, but no nice solution. So I decided to post one I came up > with. > > The problem is that graphs output as eps files, for example using > > ps.options(onefile=FALSE, paper="special", width=8, height=8, > horizontal=FALSE, pointsize=12) > > get rotated when I convert them to pdf using epstopdf. Both ghostview > and acroread display them rotated, so I don't think it's an actual > acroread bug. I am using R 1.8.1. > > The solution is to "distill" the files using eps2eps, part of > ghostscript on my Debian box. Here is an example Makefile I use for > this: > > ---- cut here ---- > EPS2EPS=eps2eps > EPSTOPDF=epstopdf > > all: graph1.pdf graph2.pdf > > %.pdf: %.raweps > $(EPS2EPS) $< $*.eps > $(EPSTOPDF) $*.eps > ---- cut here ---- > > So I have a fix now, and it works. But I still think that either the > postscript() function in R, or both acroread and gs are broken. I know > no ps/pdf, so I can't decide which, but in the long run, somebody with > some ps/pdf expertise and a bit of time could look at this problem. > > Best, > > Tamas >