Hello ALL: I ran with success the following commands in R getting a file saved ------------------------------------------------------------------------------------ postscript() postscript('~/data/st202/2003/lecture00/lecture00-graph-01.eps', horizontal = FALSE, height = 6, pointsize = 10) hist(trial.outcome.5, breaks = 5, main = '1000 Replications of 5 Trials of a Coin Toss', xlab = 'Frequency of a Tail') ------------------------------------------------------------------------------------ But when I try to include it within a LaTeX document, I get the following complaint. LaTeX document (trix.tex): ------------------------------------------------------------------------------------ \documentclass[11pt]{article} \usepackage[pdftex]{graphicx,color} \begin{document} \includegraphics{lecture00-graph-01.eps} \end{document} ------------------------------------------------------------------------------------ Which I try to compile with the command: pdflatex trix.tex But then, I get this error: ------------------------------------------------------------------------------------ ! LaTeX Error: Unknown graphics extension: .eps. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.5 \includegraphics{lecture00-graph-01.eps} ? ------------------------------------------------------------------------------------ Any suggestions? Thanks, ANDREW
Hi, ----- Original Message ----- From: "Andrew Criswell" <arc at arcriswell.com> To: "r-help" <r-help at stat.math.ethz.ch> Sent: Friday, August 22, 2003 2:17 AM Subject: [R] Getting graphs into LaTeX> Hello ALL: > > I ran with success the following commands in R getting a file saved > ------------------------------------------------------------------------------------> postscript() > > postscript('~/data/st202/2003/lecture00/lecture00-graph-01.eps', > horizontal = FALSE, height = 6, pointsize = 10) > > hist(trial.outcome.5, breaks = 5, > main = '1000 Replications of 5 Trials of a Coin Toss', > xlab = 'Frequency of a Tail') > ------------------------------------------------------------------------------------ Have you closed the postscript device? Normally you need a dev.off() after you finished the plot. Try putting dev.off() after your hist(). The other thing is can you actually view "lecture00-graph-01.eps" in the directory, with a postscript Viewer? The last point, I think pdflatex (or pdftex) does not accept PS/EPS formatted picture. Can you latex trix.tex? If so, try to save your histogram as a PDF or PNG file, then pdflatex it again. Cheers, Kevin ------------------------------------------------ Ko-Kang Kevin Wang Master of Science (MSc) Student Department of Statistics University of Auckland New Zealand www.stat.auckland.ac.nz/~kwan022 ********************************************
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.)
On Thu, Aug 21, 2003 at 08:17:05PM +0700, Andrew Criswell wrote:> Which I try to compile with the command: pdflatex trix.tex > > But then, I get this error: > ------------------------------------------------------------------------------------ > ! LaTeX Error: Unknown graphics extension: .eps."pdflatex" wants pdf-pics, not eps. If you want to use both, latex & pdflaex, save one version with pdf(), one version with postscript and use \includegraphics{~/xx} without ending. pdflatex & latex will choose the appropiate file. pm -- P.Malewski, Limmerstr.47, 30451 Hannover, 0511-2135008 At work: http://www.MH-Hannover.de 0511 532 3194 / Fax: 0511 532 3190, P.Malewski at tu-bs.de, peter.malewski at gmx.de, malewski.peter at mh-hannover.de.
Thanks to all who responded to my inquiry. Bingo, it works! I revised the code as follows and it works fine: For the R code: _______________________________________________ pdf() pdf('lecture00-graph-01.pdf', horizontal = FALSE, height = 6, pointsize = 10) hist(trial.outcome.5, breaks = 5, main = '1000 Replications of 5 Trials of a Coin Toss', xlab = 'Frequency of a Tail') dev.off() _______________________________________________ For the LaTeX document: _______________________________________________ \documentclass[11pt]{article} \usepackage[pdftex]{graphicx,color} \begin{document} \includegraphics{lecture00-graph-01} \end{document}
Hi R developers: I am collecting the elements to Build R on W2K. But I found that the www.fptex.org link, lead me to www.dante.de site. In this site I don't found where to download the fptex software. And worst: ich spreche kein Deutch!!! Danke sehr!