KnowledgeBoat Logo
|

Informatics Practices

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.

  1. Both A and R are true and R is the correct explanation of A.
  2. Both A and R are true but R is not the correct explanation of A.
  3. A is true but R is false.
  4. A is false but R is true.

PyPlot

2 Likes

Answer

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.

Answered By

1 Like


Related Questions