Embedding Matplotlib in a Glade application
Glade is a user interface designer that allows to create and edit user interfaces for GTK+ applications.
Glade is used to place GTK+ widgets in a GUI, and change the layout or the properties of each widget. It also allows to add connections between those widgets and the application code.
Glade stores the GUI design in an XML format, and by using libglade
, Glade XML files can be dynamically loaded in applications developed in several programming languages (Python included).
The example we are going to present is about counting the letters in a file and then plotting the result. If you have ever studied basic cryptography, you were taught that e is the most common letter in the English writings—this is your chance to experimentally verify that!
Before presenting and discussing the Python code, we will describe how we have designed the GUI with Glade.
Designing the GUI using Glade
When Glade executable is started (with no glade
file as parameter), it...