legend() (Matplotlib)

ax.legend() adds a key to a plot that maps each line, marker, or bar to its label, so readers can tell multiple series apart. It uses the label you assigned…