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 (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 |
||||
|
|
|
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 |
|||
|
|
|
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. |
|||
|
|
TikZ/PGFis simpler than matplotlib. However, it produced much nicer results. Withmatplotlib, I always have issues when I want larger fonts; I usually reduce the figure-size while keeping font-sizes, but then labels fall outside the figure. Calculating bounding-boxes is one of the strengths ofLaTeX, so I would recommendpgfplots, not because it's simpler, but because it produces nicer results, particularly when larger fonts are needed (like in presentations). – gerrit Dec 9 '11 at 9:31