I wanted to use pylab for some interactive work (event handling etc), and to use wxpython to drag and drop file names, set parameters and the like. I didn’t really have time/was too lazy to learn how to use the matplotlib api, so I spent some time trying to get the 2 to work together. This works for me in Windows XP.
First, in your matplotlibrc file, set
WXAgg (the default TkAgg doesn’t work and WX is slower).
from matplotlib import use
before you import pylab.
Some have said that you need to set interactive to True, but I prefer to use
ioff() and force
draw as follows:
ion() # turn interactive mode on else figure won’t display
figure() # new figure
ioff() # set all values first before drawing because this is slow otherwise
# insert plots etc here #
draw() # force redraw of the figure you’ve created
It seems like that’s all there is to it, though I may have forgotten something…