Software Agonies: SciPy

In connection with some super-top-secret project — as in, it’s so classified I could figure out what I’m doing, but then I’d have to kill myself — I’ve been coding some programs with SciPy, a bundle of open-source science, math and engineering tools for Python. The thing I need the most is a platform-independent way to plot graphs, and for the most part, SciPy has worked pretty well. I’ve only had one truly infuriating problem so far. That problem, to which I devoted more of my life than I’d like to think about right now, stemmed from the following bug.

SciPy uses Matplotlib to make its visual output, and as the name suggests, Matplotlib was designed with MATLAB syntax in mind. Those of you who have done subplots in MATLAB — multiple graphs tiled onto the same figure — may recall that the subplot command has two valid syntax forms: subplot(211) and subplot(2,1,1), the first being the older form. According to the Matplotlib documentation, both forms work.

They don’t.

Using the older MATLAB syntax, the one without the commas, the graphs display as intended. Using the newer syntax, which in principle allows for more subplots on a given figure, doesn’t: all the graphs are drawn in the same box, so only the last graph drawn is visible.

This behavior has only reported in Ubuntu (dapper) and Debian (testing/unstable).

How much of my life did I lose to those two commas, never to get back?

I’d rather not say.