In this recipe, we will learn how to leverage the Qt GUI Slider and Button widgets in place of Matplotlib widgets. Code in this and the next recipe should work for both the Qt4 as well as Qt5 GUI versions.
The Qt GUI is very similar to the wxPython GUI. In place of the sizer, we will have QHBoxLayout and QVBoxLayout; in place of fig.canvas.manager.window, we will have fig.canvas.setLayout; and in place of Bind, we will have connect.