O'Reilly logo

matplotlib Plotting Cookbook by Alexandre Devert

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Integrating a plot to a wxWidgets user interface

Using Tkinter, we can combine the plotting abilities of matplotlib and a fully featured GUI library. This solution has the advantage of relying on standard Python only. However, a classical argument against Tkinter is how it looks: the user interface has a look and feel of its own, not the look and feel of the platform it runs on.

The wxWidgets user interface is another GUI module for Python, binding the wx library. The wx library exposes a common API to create graphical interfaces on Windows, OS X, and Linux. The graphical interfaces created with wx will have the look and feel of the platform they run on. In this recipe, we will look at how we can interface wxWidgets with matplotlib.

How to do it... ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required