Thursday, May 9, 2013

Baby Got Backends

What are backends? I mean matplotlib backends for the nearly ubiquitous scientific graphic Python package that complements NumPy/SciPy so well. You can use several graphics libraries including Qt4, GTK, wx and Tk (which is the default). Here in no order are what these backends look like on Windows 7.

Qt4Agg

This is probably the nicest. It is the only one that has the special added feature of allowing you to set the figure title, axes labels and line and marker type and color. Also it is the only one with normal looking sliders.
matplotlib Qt4Agg backend
Qt4Agg backend
 Here you can see the curves tab of the extra figure options box.
matplotlib Qt4Agg backend curves tab of figure options
Curves tab of the figure options box (Qt4Agg backend)

GTKAgg

The other backends look nearly identical. Here is the GTK backend. The sliders are the same as Tk, but the main figure window has buttons whose edges only light up when you hover over them, giving it a slightly more modern look than the TkAgg backend.
matplotlib GTKAgg backend
GTKAgg backend

TkAgg

Here is the default backend. See what I mean about the buttons; but maybe you like that? I know on mac, Tk looks pretty nice, but on Linux and Windows, I think it looks more primitive than the other backends.

matplotlib TkAgg backend
TkAgg backend

wxAgg

The only noticeable difference between wx and the GTK to me was the extra status bar underneath the toolbar. GTK and Tk both put the status on the right side of the toolbar, which makes better use of space, IMHO. Also the nav buttons in the wx backend were grey not blue, and the favicon's were broken - not matplotlibs squiggly curve icon that the other backends used - but that might just be my computer?
matplotlib wxAgg backend
wxAgg backend

Fork me on GitHub