What is the purpose of the legend() function in Matplotlib?
Show answerHide answer
Correct answer: (C) To label different lines or markers on a plot
Explanation
legend() adds a legend box that labels each line or marker on the plot, using the label= values given when plotting.