x = [1, 2, 3, 4, 5] y1 = [1, 2, 3, 4, 5] y2 = [5, 4, 3, 2, 1] plt.plot(x, y1, label='Ascending') plt.plot(x, y2, label='Descending') plt.legend() plt.title('Adding a Legend') plt.show()