[R] Getting graphs into LaTeX

A.J. Rossini rossini at blindglobe.net
Fri Dec 20 07:59:03 CET 2002


pdflatex needs pdf,jpg, or other formats -- it can't handle eps.

best,
-tony

>>>>> "andrew" == Andrew Criswell <arc at arcriswell.com> writes:

    andrew> Hello ALL:
    andrew> I ran with success the following commands in R getting a file saved
    andrew> ------------------------------------------------------------------------------------
    andrew> postscript()

    andrew> postscript('~/data/st202/2003/lecture00/lecture00-graph-01.eps',
    andrew>            horizontal = FALSE, height = 6, pointsize = 10)

    andrew> hist(trial.outcome.5, breaks = 5,
    andrew>      main = '1000 Replications of 5 Trials of a Coin Toss',
    andrew>      xlab = 'Frequency of a Tail')
    andrew> ------------------------------------------------------------------------------------
    andrew> But when I try to include it within a LaTeX document, I get the
    andrew> following complaint.

    andrew> LaTeX document (trix.tex):
    andrew> ------------------------------------------------------------------------------------
    andrew> \documentclass[11pt]{article}
    andrew> \usepackage[pdftex]{graphicx,color}
    andrew> \begin{document}
    andrew> \includegraphics{lecture00-graph-01.eps}
    andrew> \end{document}
    andrew> ------------------------------------------------------------------------------------
    andrew> Which I try to compile with the command:  pdflatex trix.tex

    andrew> But then, I get this error:
    andrew> ------------------------------------------------------------------------------------
    andrew> ! LaTeX Error: Unknown graphics extension: .eps.

    andrew> See the LaTeX manual or LaTeX Companion for explanation.
    andrew> Type  H <return>  for immediate help.
    andrew>  ...

    andrew> l.5 \includegraphics{lecture00-graph-01.eps}

    andrew> ?
    andrew> ------------------------------------------------------------------------------------
    andrew> Any suggestions?

    andrew> Thanks,
    andrew> ANDREW

    andrew> ______________________________________________
    andrew> R-help at stat.math.ethz.ch mailing list
    andrew> http://www.stat.math.ethz.ch/mailman/listinfo/r-help


-- 
A.J. Rossini				Rsrch. Asst. Prof. of Biostatistics
U. of Washington Biostatistics		rossini at u.washington.edu	
FHCRC/SCHARP/HIV Vaccine Trials Net	rossini at scharp.org
-------------- http://software.biostat.washington.edu/ ----------------
FHCRC: M: 206-667-7025 (fax=4812)|Voicemail is pretty sketchy/use Email
UW:   Th: 206-543-1044 (fax=3286)|Change last 4 digits of phone to FAX
(my tuesday/wednesday/friday locations are completely unpredictable.)




More information about the R-help mailing list