CairoPlot is a Python module that uses the Cairo graphics package to produce great-looking charts easily. The results look really nice and are much simpler to create than many other packages, but up until now it has been suboptimal for use with LaTeX documents. I’ve been talking with the package maintainer and filing bugs about these inadequacies, and my concerns were quickly addressed. See the CairoPlot Launchpad page to view the bugs filed against it.
I also recently found a blog post about embedding python in LaTeX files [UPDATE: post appears to have gone offline. Here is a backup copy of python.sty, thanks to Steve Checkley]. Using this with CairoPlot, it is easy to put the chart-producing code directly in my .tex files and compile. This reduces the extra step of making separate python scripts to produce these charts. Here is some sample code from a paper I’m currently writing:
[ [0.87, 0.82], [0.83, 0.50], [0.70, 0.11] ],
340, 280, background = None, border = 10, grid = True,
x_labels = ['Parses', 'Generates', 'Generates Original'],
y_labels = ['%d%%' % i for i in range(0,110,10)],
y_bounds = (0,1) )
I do have some gripes about python.sty, though. I have to remember to use the latex command with the “–shell-escape” option. Also, it produces files for the python code, stderr and stdout output, and I don’t particularly care for the directory getting cluttered up with temporary files. Because of these annoyances, I might forgo the python.sty method and just keep a python script that generates all the charts.