[R] How to paste graph from R in Latex?

Vincent Goulet vincent.goulet at act.ulaval.ca
Sat May 17 03:51:24 CEST 2008


Le ven. 16 mai à 21:24, Roslina Zakaria a écrit :

> Dear R-expert,
> Is it possible to save graph from R into Latex document? I can see  
> save as metafile , PNG, pdf etc, but I'm not sure which one to use.
> Thank  you so much for your help.

If you use latex, you should go for Encapsulated PostScript (EPS)  
using the postscript() device. With pdflatex, you may opt for PDF.

Want a good hint? Have a look at Sweave[1] and let it take care of the  
graph for you. That way, the code to create the graph will be saved  
with your LaTeX document.

HTH    Vincent

[1] See http://www.statistik.lmu.de/~leisch/Sweave/

---
   Vincent Goulet, Associate Professor
   École d'actuariat
   Université Laval, Québec
   Vincent.Goulet at act.ulaval.ca   http://vgoulet.act.ulaval.ca



More information about the R-help mailing list