Hi all, I have started using LaTeX for writing papers and I have heard that R works well with LaTeX. I'm specifically interested in how I can have LaTeX read in R generated graphics - for example graphs formed by matplot, or other such processes. Does anyone out there use LaTeX and can point me in the right direction? Thanks David -- ======================================================================David Kaplan, Ph.D. Professor Department of Educational Psychology University of Wisconsin - Madison Educational Sciences, Room 1061 1025 W. Johnson Street Madison, WI 53706 email: dkaplan at education.wisc.edu Web: http://www.education.wisc.edu/edpsych/facstaff/kaplan/kaplan.htm Phone: 608-262-0836 Fax: 608-262-0843
Hi David, You can export the graphs in (encapsulated) postscript format, or in PDF/PNG/JPEG format. The following functions may be helpful: postscript() png() pdf() You may also want to check out Sweave (http://www.ci.tuwien.ac.at/~leisch/Sweave/), it allows you to integrate LaTeX and R neatly. Cheers, Kevin David Kaplan wrote:> Hi all, > > I have started using LaTeX for writing papers and I have heard that R > works well with LaTeX. I'm specifically interested in how I can have > LaTeX read in R generated graphics - for example graphs formed by > matplot, or other such processes. Does anyone out there use LaTeX and > can point me in the right direction? > > Thanks > > David > > >-- Ko-Kang Kevin Wang Ph (H): +61-2-612 57471 Ph (M): +61-40-4518301 http://wwwmaths.anu.edu.au/~wangk/personal/
Hi David, I strongly recommend that you use Sweave to mediate LaTeX and R. http://www.ci.tuwien.ac.at/~leisch/Sweave/FAQ.html Cheers Andrew On Sat, Dec 09, 2006 at 10:39:19PM -0600, David Kaplan wrote:> Hi all, > > I have started using LaTeX for writing papers and I have heard that R > works well with LaTeX. I'm specifically interested in how I can have > LaTeX read in R generated graphics - for example graphs formed by > matplot, or other such processes. Does anyone out there use LaTeX and > can point me in the right direction? > > Thanks > > David > > > > -- > ======================================================================> David Kaplan, Ph.D. > Professor > Department of Educational Psychology > University of Wisconsin - Madison > Educational Sciences, Room 1061 > 1025 W. Johnson Street > Madison, WI 53706 > > email: dkaplan at education.wisc.edu > Web: http://www.education.wisc.edu/edpsych/facstaff/kaplan/kaplan.htm > Phone: 608-262-0836 > Fax: 608-262-0843 > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.-- Andrew Robinson Department of Mathematics and Statistics Tel: +61-3-8344-9763 University of Melbourne, VIC 3010 Australia Fax: +61-3-8344-4599 http://www.ms.unimelb.edu.au/~andrewpr http://blogs.mbs.edu/fishing-in-the-bay/
David Kaplan <dkaplan at education.wisc.edu> wrote:> Hi all, > > I have started using LaTeX for writing papers and I have heard that R > works well with LaTeX. I'm specifically interested in how I can have > LaTeX read in R generated graphics - for example graphs formed by > matplot, or other such processes. Does anyone out there use LaTeX and > can point me in the right direction?> DavidDavid-- The basic paradigm is to save the graph from R in encapsulated Postscript format. The procedure can vary slightly by the OS you are using R under. Under Windows, I usually generate the graphics in the windows() device, then use savePlot to save it to eps. In Latex, you can put \usepackage{graphicx} in the document preamble and something like \begin{figure}[!th] \includegraphics[height=8in]{figurename.eps}\\ \end{figure} into the text to put the figure in a float. To put in exactly where the statement occurs, omit putting it into a figure environment. HTH, --Mike -- Mike Prager, NOAA, Beaufort, NC * Opinions expressed are personal and not represented otherwise. * Any use of tradenames does not constitute a NOAA endorsement.