O'Reilly logo

IPython Interactive Computing and Visualization Cookbook - Second Edition by Cyrille Rossant

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

Creating statistical plots easily with seaborn

seaborn is a library that builds on top of Matplotlib and Pandas to provide easy-to-use statistical plotting routines. In this recipe, we give a few examples, adapted from the official documentation, of the types of statistical plot that can be created with seaborn.

How to do it...

  1. Let's import NumPy, Matplotlib, and seaborn:
    >>> import numpy as np
        from scipy import stats
        import matplotlib.pyplot as plt
        import seaborn as sns
        %matplotlib inline
  2. seaborn comes with built-in datasets, which are useful when making demos. The tips dataset contains bills and tips for taxi journeys:
    >>> tips = sns.load_dataset('tips')
        tips
  3. seaborn implements easy-to-use functions to visualize the distribution of datasets. Here, ...

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