Chapter 6. Embedding Matplotlib in Qt 4
There are several GUI libraries available, and one of the most famous is Qt. In this book, we will use Qt 4, the latest major version of this library. Unless explicitly mentioned, when we write Qt, we are referring to Qt 4.
We will follow the same progression as in the GTK+ chapter, and we will present the same examples, but this time written in Qt.
We believe that this method will allow us to directly compare the libraries, and it has the advantage of not leaving the "How would I write something with library X?" question unanswered.
During this chapter, we will see how to:
Embed a Matplotlib
Figure
into a Qt widgetEmbed a
Figure
and navigation toolbar into a Qt widgetUse events to update in real-time a Matplotlib plot
Use Qt Designer to draw a GUI and then use it with Matplotlib in a simple Python application
We begin by giving an introduction to the library.
Brief introduction to Qt 4 and PyQt4
Qt is a cross-platform application development framework, widely...