CBSE Class 12 Informatics Practices
Question 5 of 73
Data Visualization using Matplotlib — Question 5
Back to all questions 5
Question Assertion (A): legend (labels = ['Text']) is used to give title to the graph.
Reasoning (R): plt.savefig("path") will save the current graph in png or jpeg format.
- Both A and R are true and R is the correct explanation of A.
- Both A and R are true but R is not the correct explanation of A.
- A is true but R is false.
- A is false but R is true.
A is false but R is true.
Explanation
The statement legend(labels=['Text']) is used to add a legend to the graph, not a title. The title of the graph is set using plt.title('Title Text'). The statement plt.savefig("path") saves the current graph to the specified path in PNG or JPEG format.