TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

Is it possible to insert dynamic graphs into your LaTeX document?

For example, let's say I want to add ABC Enterprise's turnover into my LaTeX document for each month. Could I do something like this @{turnover, Jan=£1000.00, Feb=£1200.00, Mar=£400.00} and then use that data to automatically render/draw a bar chart?

Or is the only way to get a graph into my LaTeX document via inserting images?

share|improve this question
up vote 1 down vote accepted

If you would like to do it with LaTeX code than it would be probably pgfplots. To me it is often faster to use an external program like gnuplot. The package pgfplots is a tool to implement graphs with the correct typesettings. See Problems in creating graphs using dataplot.


Could you give a minimal example of your database? Your procedure is dependent on the shape of the database. You maybe like to follow How typeset a numeric table from a CSV file.


Remember that you mostly do not want to compile the graphs everytime you compile the latex-main file.

share|improve this answer
pgfplots and datatool can do that pretty conveniently. Here are many examples of it pgfplots tagged questions , datatool tagged questions – percusse Apr 13 '13 at 12:34

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.