I have recently "printed" in R to a postscript file. I'm working on a SSH without an X terminal. It was fairly automatic:> plot(x,y) > dev.off()And then the default creates a file called Rplots.ps which I can ftp to my laptop and open in Ghostscript. I can see the file, and nothing looks odd. However, when I import it into LaTeX, it refuses to configure right side up. (It stays 90 degrees.) I've tried saving it as .eps with different options in ghostscript. I've also tried many different rotating commands in LaTeX (angle in \includegraphics, \rotate, \sideways,...) But, the picture seems to be unaffected by any of these commands. Does anyone know a trick to getting R postscript files into LaTeX? Thanks, Jo Johanna Hardin Department of Mathematics & Computer Science 610 N. College Way Pomona College Claremont, CA 91711 (909) 607-8717 jo.hardin@pomona.edu [[alternative HTML version deleted]]
You can specify the postscript() option horizontal=F. See help on "horizontal" in ?postscript. HTH, Jerome On July 23, 2003 11:42 am, Johanna Hardin wrote:> I have recently "printed" in R to a postscript file. I'm working on a > SSH > > without an X terminal. It was fairly automatic: > > plot(x,y) > > dev.off() > > And then the default creates a file called Rplots.ps which I can ftp to > my laptop and open in Ghostscript. I can see the file, and nothing > looks odd. However, when I import it into LaTeX, it refuses to configure > right side up. (It stays 90 degrees.) I've tried saving it as .eps with > different options in ghostscript. I've also tried many different > rotating commands in LaTeX (angle in \includegraphics, \rotate, > \sideways,...) But, the picture seems to be unaffected by any of these > commands. > > Does anyone know a trick to getting R postscript files into LaTeX? > > Thanks, Jo > > Johanna Hardin > Department of Mathematics & Computer Science > 610 N. College Way > Pomona College > Claremont, CA 91711 > (909) 607-8717 > jo.hardin at pomona.edu > > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Did you read ?postscript ? You want an encapsulated PS (EPS) file to include in LaTeX, and that page tells you the options required. On Wed, 23 Jul 2003, Johanna Hardin wrote:> I have recently "printed" in R to a postscript file. I'm working on a SSH > without an X terminal. It was fairly automatic: > > > plot(x,y) > > dev.off() > > And then the default creates a file called Rplots.ps which I can ftp to my > laptop and open in Ghostscript. I can see the file, and nothing looks odd. > However, when I import it into LaTeX, it refuses to configure right side up. > (It stays 90 degrees.) I've tried saving it as .eps with different options > in ghostscript. I've also tried many different rotating commands in LaTeX > (angle in \includegraphics, \rotate, \sideways,...) But, the picture seems > to be unaffected by any of these commands. > > Does anyone know a trick to getting R postscript files into LaTeX? > > Thanks, Jo > > Johanna Hardin > Department of Mathematics & Computer Science > 610 N. College Way > Pomona College > Claremont, CA 91711 > (909) 607-8717 > jo.hardin at pomona.edu > > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help >-- 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
On Wed, 23 Jul 2003, Johanna Hardin wrote:> in ghostscript. I've also tried many different rotating commands in LaTeX > (angle in \includegraphics, \rotate, \sideways,...) But, the picture seems > to be unaffected by any of these commands.I find it the rotation won't show up in the DVI file, but will once you convert the DVI file into a PS file. But that's another story.> Does anyone know a trick to getting R postscript files into LaTeX?When I need to generate a PS file in R I always do something like: postscript("foo.eps", height = 6.9, width = 6.6, horizontal = FALSE, onefile = FALSE, print.it = FALSE) plot(1:10) dev.off() then in my LaTeX file do something like: \begin{figure}[h!] \centering \begin{center} \includegraphics[width = .8\textwidth]{foo.eps} \end{center} \caption{My Caption} \label{fig:foo} \end{figure} -- Cheers, Kevin ------------------------------------------------------------------------------ "On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question." -- Charles Babbage (1791-1871) ---- From Computer Stupidities: http://rinkworks.com/stupid/ -- Ko-Kang Kevin Wang Master of Science (MSc) Student SLC Tutor and Lab Demonstrator Department of Statistics University of Auckland New Zealand Homepage: http://www.stat.auckland.ac.nz/~kwan022 Ph: 373-7599 x88475 (City) x88480 (Tamaki)