We can now start to describe how to embed a Matplotlib
Figure into a GTK+ window as we walk through the code. We will present a simple example, and describe it step-by-step, highlighting the important parts of the code, in particular the GTK+ related ones.
Note again, we are not going to explain the GTK+ functionalities completely, and it is left to the reader to read further if he/she is interested.
import gtk from matplotlib.figure import Figure import numpy as np
These are the usual imports along with the
gtk module, which is required to access the GTK+ library functions. Once imported, the
gtk module also takes care of GTK+ environment initialization.
It is also common to find this type ...