Introduction
wxPython comes with a simple plotting library called PyPlot which is an improvement over wxPlotCanvas, which is now deprecated. PyPlot features include zooming, legends and a grid. Possible graphs: scatter, line, and bar graphs.
So why do we worry to embed matplotlib if wxPython has a plotting by defualt? The simple answer is because of the rich features available in matplotlib library.
I will demostrate a minimal approach to embed MatPlotLib figure into a GUI based on wxPython classic (for Python 2.7.12). This article could also be used for Python 3 on wxPython Phoenix with little modifications. The final result is shown below:-
MatPlotLib figure is a GUI with little controls/widgets, so python programmers often embed the figure into a richer GUI libarary such as wxPython, TkInter, PyQt/PySide etc in order to obtain the most advantage of a GUI application. In this article, am going to use the wxPython GUI libarary.