-
Book Overview & Buying
-
Table Of Contents
Matplotlib for Python Developers
So far in this book, we have seen a lot of examples, and in all of them we used the matplotlib.pyplot module to create and manipulate the plots, but this is not the only way to make use of the Matplotlib plotting power.
There are three ways to use Matplotlib:
pyplot: The module used so far in this book
pylab: A module to merge Matplotlib and NumPy together in an environment closer to MATLAB
Object-oriented way: The Pythonic way to interface with Matplotlib
Let's first elaborate a bit about the pyplot module: pyplot provides a MATLAB-style, procedural, state-machine interface to the underlying object-oriented library in Matplotlib.
A state machine is a system with a global status, where each operation performed on the system changes its status.
matplotlib.pyplot is stateful because the underlying engine keeps track of the current figure and plotting area information, and plotting functions change that information. To make it clearer, we did not use...