[R] a fix for rotated PDF graphs

Tamas Papp tpapp at axelero.hu
Sat Apr 3 11:07:38 CEST 2004


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.




More information about the R-help mailing list