The matplotlib library

The first library we'll take a look at is matplotlib. The matplotlib library is the center of the Python plotting library universe. Originally created to emulate the plotting functionality of MATLAB, it grew into a fully-featured library in its own right with an enormous range of functionality. If you have not come from a MATLAB background, it can be hard to understand how all the pieces work together to create the graphs you see. I'll do my best to break down the pieces into logical components so you can get up to speed quickly. But before diving into matplotlib in full, let's set up our Jupyter Notebook to allow us to see our graphs inline. To do this, add the following lines to your import statements:

import matplotlib.pyplot ...

Get Python Machine Learning Blueprints - Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.