Once we start plotting more than one line of data points, things might become a little bit unclear. So by adding a legend to our graphs, we can tell which data is what, and what it actually means.
We do not have to choose different colors to represent the different data. Matplotlib automatically assigns a different color to each line of the data points.
All we have to do is create the chart and add a legend to it.