Book Image

IPython Interactive Computing and Visualization Cookbook

By : Cyrille Rossant
Book Image

IPython Interactive Computing and Visualization Cookbook

By: Cyrille Rossant

Overview of this book

Table of Contents (22 chapters)
IPython Interactive Computing and Visualization Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Creating beautiful statistical plots with seaborn


matplotlib comes with a high-level plotting API called pyplot. Inspired by MATLAB (a widespread commercial software for numerical computing), this interface may be a bit too low-level for scientists, in that it can lead to boilerplate code that is difficult to read and maintain. Yet, it is probably one of the most widely used plotting interfaces in the scientific Python community.

There exist higher-level, more convenient plotting interfaces. In this recipe, we present seaborn created by Michael Waskom. This library exposes a high-level plotting API that is specifically adapted to statistical figures. It also integrates nicely with pandas.

Getting ready

You will find the installation instructions of seaborn on the project's page at http://github.com/mwaskom/seaborn. You can just type pip install seaborn in a terminal.

How to do it…

  1. Let's import NumPy, matplotlib, and seaborn:

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