[R] a fix for rotated PDF graphs

Roger D. Peng rpeng at jhsph.edu
Sat Apr 3 19:47:32 CEST 2004

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



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

More information about the R-help mailing list