How to give the chart a legend

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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.136.18.218