matplotlib and seaborn essentials

matplotlib is the main plotting library in Python. While it is particularly rich and powerful, it may be difficult to use sometimes. Further, its default styling could be better. There is some work in progress to improve the default styling in matplotlib. In the meantime, the seaborn library offers better styling for matplotlib as well as easy-to-use high-level statistical plotting routines based on matplotlib.

In this section, we will detail some of the main plotting capabilities of matplotlib, while using the seaborn styling.

We first import matplotlib and seaborn and we activate the inline mode in the Notebook:

In [1]: import numpy as np
        import matplotlib.pyplot as plt
        import seaborn
        %matplotlib inline

Note ...

Get Learning IPython for Interactive Computing and Data Visualization - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.