We are creating an easy-to-use LaTeX template for our institution. I'd like to have a pure LaTeX way to create simple bar graphs and pie charts. Does anything exist? I can certainly throw the students at matplotlib or gnuplot, but it would be nice to have something simpler.
The usual answer here is the
pgfplots package, which is based on TikZ. Note that it does not do pie charts, as these are considered misleading by many people. (There is some discussion of this issue in the TikZ manual.)
(Note: As mathematicians use 'graphs' for something entirely different, the usual way to refer to data display in a graphical form is as a 'plot'. You'll find a number of plot-related questions on the site.)
Pure (La)TeX charts are possible in a variety of ways. Most notable are the options offered by TikZ/PGF and PStricks. See the respective documentations for ample examples on the functionality and use.
Although PStricks is predominantly Postscript orientated, it can be used in PDF environments as well by using the
Using PStricks, the
pst-bar package provides an interface for bar charts. View the PStricks bar chart gallery for more on the possibilities. The PStricks pie chart gallery also has some neat examples of pie charts. PStricks also has
pst-plot from plotting charts from external files (or not).
pst-2dplot provides an interface for a variety of 2D plots (see the 2D gallery page), while
pst-3dplot does the same for surfaces and other 3D charts (see the 3D gallery page).
An answer depends, in part, on what you mean by "pure" LaTeX. MetaPost, as this page mentions, is included in the TeXLive distribution and there is extensive documentation on Piecharts in MetaPost that can be downloaded here. Likewise, there is a Python package for Latex here so you can run LaTeX, jump into Python, create your graphs and jump back. There is a sagetex package as well (for Sage) and one for gnuplot. With respect to PSTricks, check the pstricks-add package for nice piecharts and the pst-func for barcharts. Note that a previous post has
pst-bar as well.
And do not forget about datatool bundle! Its user interface is not the easiest to use (and it is also quite verbose), but you can wrap it into a few macros of your own and then it might be very useful.