What is plt.legend is for?

what is plt.legend is for ?

Hey @samflash, plt.legend() is to show legends on the graph. For example when we plot line graph for year 2016 and 2017. The red line is for 2016 and blue line is for 2017. So we need to show that on graph and as in childhood we use legends to show same is here as well.

Hope this cleared your doubt. :blush:

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.