[IPython-user] New flags of interest to matplotlib users

Fernando Perez fperez.net@gmail....
Wed Dec 12 02:36:41 CST 2007


Hi all,

in SVN, I just added the ability to manually control the pylab
threading backend choice directly from the command line.  So for
example if by default you have:

tlon[~]> ipython  -pylab --nobanner

In [1]: matplotlib.rcParams['backend']
Out[1]: 'TkAgg'

You can now do this as well:

tlon[~]> ipython -wthread -pylab --nobanner

In [1]: matplotlib.rcParams['backend']
Out[1]: 'WXAgg'

In [2]:
Closing threads... Done.
tlon[~]> ipython -gthread -pylab --nobanner

In [1]: matplotlib.rcParams['backend']
Out[1]: 'GTKAgg'

The feature is fairly simplistic: the -Xthread flags map automatically
to the XAgg backends in MPL, with no more fine-grained choice than
that.  We can later look into allowing explicit backend selection if
you really scream for it, but I'd rather keep this simple. This means
that if you don't have the *Agg builds of the GUI backends, you'll
still need to do the backend selection by hand as before (i.e. by
modifying your mpl config file).

This has often been requested and I'd needed it myself on multiple
occasions, so it's finally in.

Cheers,

f

ps - note to self: finish docs for this! (though it is unit tested,
which is a whole new experience for ipython...)


More information about the IPython-user mailing list