1import numpy as np
2import matplotlib.pyplot as plt
3
4def example_legend():
5 plt.clf()
6 x = np.linspace(0, 1, 101)
7 y1 = np.sin(x * np.pi / 2)
8 y2 = np.cos(x * np.pi / 2)
9 plt.plot(x, y1, label='sin')
10 plt.plot(x, y2, label='cos')
11 plt.legend()
12