O'Reilly logo

IPython Interactive Computing and Visualization Cookbook 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

Making nicer matplotlib figures with prettyplotlib

matplotlib is sometimes criticized for the default appearance of its figures. For example, the default color maps are neither aesthetically appealing nor do they present perceptually clear information.

There are many attempts to circumvent this problem. In this recipe, we will present prettyplotlib, created by Olga Botvinnik. This lightweight Python library considerably improves the default styling of many kinds of matplotlib figures.

Getting ready

You will find the installation instructions of prettyplotlib on the project's page at http://github.com/olgabot/prettyplotlib. You can basically just do pip install prettyplotlib in a terminal.

How to do it…

  1. Let's first import NumPy and matplotlib:
    In [1]: ...

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