[R] Latex Question

Jonathan Baron baron at cattell.psych.upenn.edu
Fri Dec 7 11:32:13 CET 2001


Here is how to print graphs for inclusion in Latex.

First make sure you've got the graph you want.  Do this by
repeating and editing the command to make the graph, in the usual
way.  (Yes, I know Miktex is good, but it isn't as good as Emacs
with ESS, although I admit that I could never configure Emacs
properly on Windows - which was reason #23.5 for giving up
Windows.)

Second, say
postscript("foo.eps")
where foo.eps is the file name.  I discovered this by
saying
apropos(postscript)
and then I looked at
?postscript

Then run the command again, and say
dev.off()

To include the graph in Latex, make sure you have something like
\usepackage[dvips]{graphicx}
in your header.  Then, where you want the graph, say something
like
\includegraphics[width=4in]{foo.eps}

Jon Baron


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list