TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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...)

share|improve this question
up vote 15 down vote accepted

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

share|improve this answer
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 '10 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"). – Torbjørn T. Aug 27 '10 at 15:19
pfgplots happily reads from external data files. The manual has a number of examples. – Joseph Wright Aug 27 '10 at 16:01

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.

share|improve this answer

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.

share|improve this answer
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 '10 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 '10 at 10:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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