A demo of matplotlib within a wx application

Interactive use is great, but I need to draw Matlplotlib plots to a window from within a wx application. The example linked to from the screenshots page (embedding_in_wx.py) is broken. I have attached a simple modified version (no toolbar, just a plot). Matplotlib window redraws are quite slow, and the default behaviour is ugly during resizing. The example shows how to modify the FigureCanvas class to redraw only during idle time. This means that there is only one redraw during resizing. The wxagg backend is chosen, as for the simple plot shown here it is quicker than the current implementation of the wx backend.

Hope someone finds this useful …

wxcanvas_demo.py (2.15 KB)