I have tried to find a neat way to include graphs from R in LaTeX documents, but have not succeeded (I work with a WinEdt/MikTeX combination). The two roads I have stumbled along so far are the following: *Generate postscript files and convert them into EPS files by means of GhostScript or other not so straightforward tools. *Generate pictex files and include these. None of these solutions have worked so far. I haven't spent so much time trying to find out what goes wrong, but since there might both LaTeX gurus and R wizards among you, I simply thought it would be better to lean on that expertize first. Any suggestions about how to achieve what really should be a simple task? --robert **************** Robert Lundqvist Dept of Quality Technology & Statistics Lulea University of Technology Sweden -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Thu, 7 Feb 2002, Robert Lundqvist wrote:> I have tried to find a neat way to include graphs from R in LaTeX documents, > but have not succeeded (I work with a WinEdt/MikTeX combination). The two > roads I have stumbled along so far are the following: > > *Generate postscript files and convert them into EPS files by means of > GhostScript or other not so straightforward tools.Generate .eps directly by using dev.copy2eps or from the menu on the graphics window or by following the instructions in ?postscript. No conversion should be needed.> *Generate pictex files and include these.That driver does work but is minimally-featured. Not recommended.> None of these solutions have worked so far. I haven't spent so much time > trying to find out what goes wrong, but since there might both LaTeX gurus > and R wizards among you, I simply thought it would be better to lean on that > expertize first. Any suggestions about how to achieve what really should be > a simple task?It really is a simple task. Use dev.copy2eps and then the graphicx package in latex. You give us no clue as to your problems, so it is difficult to give any advice. -- 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 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Dear Robert, You can easily include R-generated pictures in Latex. One easy way is to use the postscript() command and including the picures in Latex using \usepackage{graphics} . It?s as easy as \includegraphics{mygraphicsfile.ps} and you can even do size customizing in Latex using some commands in this package. (Good documentation included.) Hope this helps, detlef On 07-Feb-2002 Robert Lundqvist wrote:> I have tried to find a neat way to include graphs from R in LaTeX documents, > but have not succeeded (I work with a WinEdt/MikTeX combination). The two > roads I have stumbled along so far are the following: > > *Generate postscript files and convert them into EPS files by means of > GhostScript or other not so straightforward tools. > > *Generate pictex files and include these. > > None of these solutions have worked so far. I haven't spent so much time > trying to find out what goes wrong, but since there might both LaTeX gurus > and R wizards among you, I simply thought it would be better to lean on that > expertize first. Any suggestions about how to achieve what really should be > a simple task? > > --robert > **************** > Robert Lundqvist > Dept of Quality Technology & Statistics > Lulea University of Technology > Sweden > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. > - > r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html > Send "info", "help", or "[un]subscribe" > (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._. > _Detlef Steuer --- http://fawn.unibw-hamburg.de/steuer.html ***** Encrypted mail preferred ***** -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Thu, 7 Feb 2002, Robert Lundqvist wrote:> I have tried to find a neat way to include graphs from R in LaTeX documents, > but have not succeeded (I work with a WinEdt/MikTeX combination).I use LyX (GUI front-end for LaTeX) under linux. For me I just save from R a postscript file, then in Lyx click "Insert Figure" and stick it in. So It's pretty automatic for me and have never had problems over 4 years of use. LyX (www.lyx.org) runs under windows. Bill -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
In general it is not difficult inserti .eps graphics in LaTeX For instance: 1)Do any graphic with postscript() or export it by File|Save as| postscript: 2) in your document put for instance \usepackage{graphicx} .... \includegraphics*[width=\textwidth]{graph.eps} cheers, vito ----- Original Message ----- From: "Robert Lundqvist" <Robert.Lundqvist at ies.luth.se> To: "'r-help at lists.R-project.org'" <r-help at stat.math.ethz.ch> Sent: Thursday, February 07, 2002 9:11 AM Subject: [R] R graphs in LaTeX documents?> I have tried to find a neat way to include graphs from R in LaTeXdocuments,> but have not succeeded (I work with a WinEdt/MikTeX combination). The two > roads I have stumbled along so far are the following: > > *Generate postscript files and convert them into EPS files by means of > GhostScript or other not so straightforward tools. > > *Generate pictex files and include these. > > None of these solutions have worked so far. I haven't spent so much time > trying to find out what goes wrong, but since there might both LaTeX gurus > and R wizards among you, I simply thought it would be better to lean onthat> expertize first. Any suggestions about how to achieve what really shouldbe> a simple task? > > --robert > **************** > Robert Lundqvist > Dept of Quality Technology & Statistics > Lulea University of Technology > Sweden > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-> r-help mailing list -- Readhttp://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html> Send "info", "help", or "[un]subscribe" > (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch >_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._. _._ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
since you are a windows-user: did you consider producing pdf? you don't only get files you can print as good as postscript but also the advantage of an easy-to-share file- format. for me (using TeXnicCenter as Latex-shell for windows) this solution was the easiest one! at the end of ths message you'll find a latex-file which shows how to include an pdf-image (in R produced with file->save as->pdf) also, i highly recommend having a look to TEXNICCENTER! nicer than any other latex-shell for windows and also free. (http://www.toolscenter.org/products/texniccenter/) cu till %## begin of latex-file \documentclass[a4paper,12pt]{report} \usepackage[latin1]{inputenc} \usepackage[pdftex]{graphicx} \begin{document} \DeclareGraphicsExtensions{.jpg,.pdf,.mps,.png} \pdfpkresolution=1200 \pdfimageresolution=1200 \immediate Here is your R-Graphic: \pdfximage width 12cm {map.pdf} \pdfrefximage 1 \end{document} %## end of latex-file -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Many thanks for all suggestions, and of course, using dev.copy2eps work. At least almost. Simple graphs are generated and copied into *.eps files, they have been included in the LaTeX document, and in the end I get a nice looking document in the DVI previewer (in my case YAP). Printing doesn't work though. I get a message saying that "..this page contains Postscript specials". Is this due to a faulty *.eps file or should I look for the root causes in the previewer? Any suggestions? --robert **************** Robert Lundqvist Dept of Quality Technology & Statistics Lulea University of Technology Sweden -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
You have to save your plots/figures in EPS format. EPS is basically the same as PS (postscript), but it is a one-page document with a "BoundingBox". Example In [R]: Alternative 1: Generate the plot *first* and then the eps file ... plot(sin(1:10), pch="+") dev.print(device=postscript, "myFigure.eps", onefile=FALSE, horizontal=FALSE) ... Alternative 2: Generate the eps file directly *without* opening a window. ... postscript(file="myFigure.eps", onefile=FALSE, horizontal=FALSE) plot(sin(1:10), pch="+") dev.off() ... Note that the arguments 'onefile=FALSE, horizontal=FALSE' are important! In the help for 'postscript' it also says that you "probably want to set ... paper = "special", but I never used this option and it has worked fine for me without it (actually I don't know what it does). In LaTeX: ... Bla bla see Figure~\ref{figMyFigure}. \begin{figure}[hbtp] \begin{center} % Scale the figure to have the height 80mm keeping % the width/height ratio. \resizebox{!}{80mm}{\includegraphics{myFigure.eps}} \end{center} \caption{The data used...} \label{figMyFigure} % <-- NOTE: After \caption! \end{figure} ... This requires that you use "\usepackage{graphics}" or "\usepackage{graphicx}" at the top your LaTeX document. [This answer is a correction of my own answer in the "Re: [R] Latex Question" thread from Dec 7, 2001: http://www.r-project.org/nocvs/mail/r-help/2001/6836.html where I forgot the argument 'horizontal=FALSE'.] Good luck! Henrik Bengtsson Dept. of Mathematical Statistics @ Centre for Mathematical Sciences Lund Institute of Technology/Lund University, Sweden (+2h UTC) Office: P316, +46 46 222 9611 (phone), +46 46 222 4623 (fax) h b @ m a t h s . l t h . s e http://www.maths.lth.se/matstat/staff/hb/ On Thu, 7 Feb 2002, Robert Lundqvist wrote:> I have tried to find a neat way to include graphs from R in LaTeX documents, > but have not succeeded (I work with a WinEdt/MikTeX combination). The two > roads I have stumbled along so far are the following: > > *Generate postscript files and convert them into EPS files by means of > GhostScript or other not so straightforward tools. > > *Generate pictex files and include these. > > None of these solutions have worked so far. I haven't spent so much time > trying to find out what goes wrong, but since there might both LaTeX gurus > and R wizards among you, I simply thought it would be better to lean on that > expertize first. Any suggestions about how to achieve what really should be > a simple task? > > --robert > **************** > Robert Lundqvist > Dept of Quality Technology & Statistics > Lulea University of Technology > Sweden > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html > Send "info", "help", or "[un]subscribe" > (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._ >-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
[Sorry, I forgot the dev.copy2eps alternative and to make the answer complete so this answer could be refered to when others ask the same question again I also added the 'paper="special' argument (as dev.copy2eps do)] You have to save your plots/figures in EPS format. EPS is basically the same as PS (postscript), but it is a one-page document with a "BoundingBox". Example In [R]: Alternative 1: Generate the plot *first* and then the eps file ... plot(sin(1:10), pch="+") dev.copy2eps("myFigure.eps") ... Alternative 2: Generate the plot *first* and then the eps file (basically the same result as the above) ... plot(sin(1:10), pch="+") dev.print(device=postscript, "myFigure.eps", onefile=FALSE, horizontal=FALSE, paper="special") ... Alternative 3: Generate the eps file directly *without* opening a plotting window first. ... postscript(file="myFigure.eps", onefile=FALSE, horizontal=FALSE, paper="special") plot(sin(1:10), pch="+") dev.off() ... Note that the arguments 'onefile=FALSE, horizontal=FALSE' (and 'paper="special"') are important! In LaTeX: ... Bla bla see Figure~\ref{figMyFigure}. \begin{figure}[hbtp] \begin{center} % Scale the figure to have the height 80mm keeping % the width/height ratio. \resizebox{!}{80mm}{\includegraphics{myFigure.eps}} \end{center} \caption{The data used...} \label{figMyFigure} % <-- NOTE: After \caption! \end{figure} ... This requires that you use "\usepackage{graphics}" or "\usepackage{graphicx}" at the top your LaTeX document. [This answer is a correction of my own answer in the "Re: [R] Latex Question" thread from Dec 7, 2001: http://www.r-project.org/nocvs/mail/r-help/2001/6836.html where I forgot the argument 'horizontal=FALSE'.] Good luck! Henrik Bengtsson Dept. of Mathematical Statistics @ Centre for Mathematical Sciences Lund Institute of Technology/Lund University, Sweden (+2h UTC) Office: P316, +46 46 222 9611 (phone), +46 46 222 4623 (fax) h b @ m a t h s . l t h . s e http://www.maths.lth.se/matstat/staff/hb/ On Thu, 7 Feb 2002, Robert Lundqvist wrote:> I have tried to find a neat way to include graphs from R in LaTeX documents, > but have not succeeded (I work with a WinEdt/MikTeX combination). The two > roads I have stumbled along so far are the following: > > *Generate postscript files and convert them into EPS files by means of > GhostScript or other not so straightforward tools. > > *Generate pictex files and include these. > > None of these solutions have worked so far. I haven't spent so much time > trying to find out what goes wrong, but since there might both LaTeX gurus > and R wizards among you, I simply thought it would be better to lean on that > expertize first. Any suggestions about how to achieve what really should be > a simple task? > > --robert > **************** > Robert Lundqvist > Dept of Quality Technology & Statistics > Lulea University of Technology > Sweden > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html > Send "info", "help", or "[un]subscribe" > (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._ >-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
--- Robert Lundqvist <Robert.Lundqvist at ies.luth.se> wrote:> I have tried to find a neat way to include graphs > from R in LaTeX documents, > but have not succeeded (I work with a WinEdt/MikTeX > combination). The two > roads ...Hi Robert, Perhaps your difficulties lie on the LaTeX side of the equation. I've used R versions 1.23, 1.31 and now 1.41; gone thru 'mass production' of numerous postscript graphics using both the menu and coding; and pulled those graphics into LaTeX (and Word)directly without a hitch--EXCEPT IN THE BEGINNING. And those problems were first-time-using-LaTeX-related. Assuming I had saved the R graphic as 'ipu238.eps' the following (edited) has worked for me: \documentclass[10pt,letterpaper]{report} ... \usepackage{graphicx} ... \begin{document} ...as can be seen in Figure \ref{fig:ipu238}. The confidence bands are wide and ... \begin{figure} \begin{center} \includegraphics[scale=0.9]{ipu238} \end{center} \caption{Intervals for plutonium 238 versus europium 154 using all samples.} \label{fig:ipu238} \end{figure} ... \end{document} FYI, I use TeXnicCenter/MikTeX for the LaTeX. They work very well together.(Note: LyX on windows is cygwin based and requires an Xserver, e.g. XFree86. Might as run Linux to begin with! Hmmm, not a bad idea, but RWin is getting pretty sweet.) Regards, Mike __________________________________________________ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Hi, I encountered a problem when I did interaction plots using the interaction.plot() function. The labels for the trace factor appeared on the plot when I did the plots in separate windows, but disappeared/cut off when multiple plots were placed in one window. Can anybody help me? Thanks. Kaiya Liu -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Michael_Nielsen/Syd/Synergy.SYNERGY@synergy.com.au
2002-Feb-07 21:56 UTC
[R] R graphs in LaTeX documents?
I'll admit to being somewhat of a graphics meathead, but recently needed to put lots of R graphics into a report that I was typesetting with LaTeX (well, pdflatex on Linux). I couldn't coerce pdflatex to use the eps graphics (it seems to be there has to be a way, but I was in too much of a hurry to try to find it), so I asked R to generate the graphics directly into PDF, and then included them into my LaTeX with an \includegraphics. To me, the result looked pretty good -- much better, in fact, than it did with either jpg or png output, although the poor result with jpg and png could well be because of my naive choices for the various settings of things required along the way. Anyway, I am continually impressed with R's ability to produce good results in spite of my somewhat inelegant (ok, ham-fisted) approach. Regards, Mike Michael Grant <mwgrant2001 at yahoo.c To: Robert Lundqvist <Robert.Lundqvist at ies.luth.se>, om> "'r-help at lists.R-project.org'" <r-help at stat.math.ethz.ch> Sent by: cc: owner-r-help at stat.ma Subject: Re: [R] R graphs in LaTeX documents? th.ethz.ch 08/02/2002 12:25 AM --- Robert Lundqvist <Robert.Lundqvist at ies.luth.se> wrote:> I have tried to find a neat way to include graphs > from R in LaTeX documents, > but have not succeeded (I work with a WinEdt/MikTeX > combination). The two > roads ...Hi Robert, Perhaps your difficulties lie on the LaTeX side of the equation. I've used R versions 1.23, 1.31 and now 1.41; gone thru 'mass production' of numerous postscript graphics using both the menu and coding; and pulled those graphics into LaTeX (and Word)directly without a hitch--EXCEPT IN THE BEGINNING. And those problems were first-time-using-LaTeX-related. Assuming I had saved the R graphic as 'ipu238.eps' the following (edited) has worked for me: \documentclass[10pt,letterpaper]{report} ... \usepackage{graphicx} ... \begin{document} ...as can be seen in Figure \ref{fig:ipu238}. The confidence bands are wide and ... \begin{figure} \begin{center} \includegraphics[scale=0.9]{ipu238} \end{center} \caption{Intervals for plutonium 238 versus europium 154 using all samples.} \label{fig:ipu238} \end{figure} ... \end{document} FYI, I use TeXnicCenter/MikTeX for the LaTeX. They work very well together.(Note: LyX on windows is cygwin based and requires an Xserver, e.g. XFree86. Might as run Linux to begin with! Hmmm, not a bad idea, but RWin is getting pretty sweet.) Regards, Mike __________________________________________________ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. -.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._. _._._ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Michael_Nielsen/Syd/Synergy.SYNERGY@synergy.com.au
2002-Feb-07 23:52 UTC
[R] R graphs in LaTeX documents?
I have no doubt it will be useful to many. On behalf of all of us for whom the pdf() driver (and, indeed R itself) has lightened the burden, thank you for your efforts! Regards, Mike Prof Brian Ripley <ripley at stats.ox.ac. To: uk> Michael_Nielsen/Syd/Synergy.SYNERGY<Michael_Nielsen/Syd/Synergy.SYNERGY at synergy. Sent by: com.au> owner-r-help at stat.ma cc: "'r-help at lists.R-project.org'" <r-help at stat.math.ethz.ch> th.ethz.ch Subject: Re: [R] R graphs in LaTeX documents? 08/02/2002 09:20 AM On Fri, 8 Feb 2002 Michael_Nielsen/Syd/Synergy.SYNERGY at synergy.com.au wrote:> I'll admit to being somewhat of a graphics meathead, but recently neededto> put lots of R graphics into a report that I was typesetting with LaTeX > (well, pdflatex on Linux). I couldn't coerce pdflatex to use the eps > graphics (it seems to be there has to be a way, but I was in too much ofa The only good way is to convert .eps to pdf (or, much worse, to png). The best way to do that is Adobe Distiller, the second-best way epsftopdf, a Perl script / Windows program calling ghostscript, preferably 6.0 or later. It is practically identical to what bitmap() does in R.> hurry to try to find it), so I asked R to generate the graphics directly > into PDF, and then included them into my LaTeX with an \includegraphics. > To me, the result looked pretty good -- much better, in fact, than it did > with either jpg or png output, although the poor result with jpg and png > could well be because of my naive choices for the various settings of > things required along the way.That's typical for the sort of graphs one produces in R.> Anyway, I am continually impressed with R's ability to produce goodresults> in spite of my somewhat inelegant (ok, ham-fisted) approach.I wrote the pdf() driver because it seemed a cleaner solution, and it was an intellectual challenge. From this thread it seems it has much more use than I realized, which is nice to know. -- 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 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. -.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._. _._._ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._