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.
- 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.
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.
Related Questions
Assertion (A): Data Visualization refers to the graphical representation of information and data using visual elements like charts, graphs and maps, etc.
Reasoning (R): To install matplotlib library, we can use the command - pip install matplotlib.
- 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.
Assertion (A): A histogram is basically used to represent data provided in the form of groups spread in non-continuous ranges.
Reasoning (R): matplotlib.pyplot.hist() function is used to compute and create histogram of a variable.
- 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.
Assertion (A): In histogram, X-axis is about bin ranges whereas Y-axis talks about frequency.
Reasoning (R): The bins (intervals) must be adjacent and are often (but are not required to be) of equal size.
- 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.
Assertion (A): Bar graph and histogram are same.
Reasoning (R): A bar graph represents categorical data using rectangular bars. A histogram represents data which is grouped into continuous number ranges and each range corresponds to a vertical bar.
- 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.