-
Book Overview & Buying
-
Table Of Contents
IPython Interactive Computing and Visualization Cookbook
By :
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.
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.
Let's first import NumPy and matplotlib:
In [1]: import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
%matplotlib inlineWe then draw several curves with matplotlib:
In [2]: np.random.seed(12)
for i in range(8):
x = np.arange(1000...
Change the font size
Change margin width
Change background colour