Getting ready

Let's import the required libraries and set up plt.rcParams(), which is also required for this recipe. These settings will be applicable to all the plots drawn in this session:

import matplotlib.pyplot as plt
import numpy as np

plt.rcParams['figure.titlesize'] = 15
plt.rcParams['legend.fontsize'] = 12
plt.rcParams['axes.labelsize'] = 12
plt.rcParams['axes.labelweight'] = 'bold'
plt.rcParams['xtick.labelsize'] = 12
plt.rcParams['ytick.labelsize'] = 12