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
Getting graphs into LaTeX
5 messages · Andrew Criswell, Ko-Kang Kevin Wang, A.J. Rossini +2 more
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, 19 Dec 2002, A.J. Rossini wrote:
pdflatex needs pdf,jpg, or other formats -- it can't handle eps.
pdf or png these days I believe. (There was tiff and jpg support once, but tiff has definitely gone.) R does have a pdf() device (and I wonder who wanted to include graphs in pdftex documents?). Otherwise eps can be converted to pdf by the script epstopdf (which calls distiller or gs) which has an executable version on Windows, epstopdf.exe.
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
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.