The legend is the description of each of the graphs on a given axes. Each axis has its own legend. Matplotlib provides many different ways in which a legend can be specified. We will cover as many combinations as possible, though we wont be able to cover a complete set of possibilities in this book.
Working with legend
Getting ready
Import the following required libraries:
import matplotlib as plt
import numpy as np
import matplotlib.patches as mpatches
from numpy.random import randn
How to do it...
The following code block plots 11 different ways a legend can be specified...