13

I have some graphs I drew in maple, some simple line plots and histograms. Now I'd like to redraw these graphs in LaTeX, so I can do fancy stuff in beamer like have one histogram appear, and then another on top of it on the next slide.

I guess one way to do this would be using R and sweave, but learning R seems like overkill, since I'm not really doing any statistical analysis: I just want to plot some data. Is there a simpler way to pass LaTeX the data in such a way that it will be able to plot the data in, say, a TikZ picture (since I already know how to use TikZ a bit...)

3 Answers 3

15

The pgfplots package might be what you need. It is based on Tikz, and lets you plot data or functions.

3
  • OK, pgfplots looks nice, is there an easy way to input data from an external source? Or should I just export the data as CSV and \input that?
    – Seamus
    Aug 27, 2010 at 14:15
  • I've haven't used it much myself, and not for that purpose, but look at the manual, sections 4.2.2 and 4.2.3 ("Reading coordinates from files" and "Reading Coordinates From Tables"). Aug 27, 2010 at 15:19
  • 6
    pfgplots happily reads from external data files. The manual has a number of examples.
    – Joseph Wright
    Aug 27, 2010 at 16:01
3

pstricks extension and more specifically pst-plot package pst-plot guide may be a good solution as well. It is also a bit problematic if you use the pdflatex engine but works very well with dvips and ps2pdf.

3

A half hour spent learning R is all you'll need. If you can work in maple, you'll find R to be simple. The good thing is that R and maple do quite different things, so time spent learning a bit of R will not be lost time. If you do any work with data, R is a tool you should investigate.

2
  • But I wouldn't be able to use R to generate the data, right? (I was using Maple to iterate the logistic map and create time series from that...)
    – Seamus
    Sep 11, 2010 at 11:38
  • Sorry, your original post ("I just want to plot some data") suggested that you have the data in a file, and wanted to read the file and plot it using latex. I don't know much about regenerating data in latex, but I know for sure that you could do such a thing in R. I think you should google "cran logistic map" and start reading what you get. If you need a quick solution, of course the best plan is to make Maple create a graph, and use includegraphics{} in latex to typeset it. That is the normal way to do things.
    – dank
    Sep 14, 2010 at 10:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.