Informatics Practices
Write the specific purpose of the following functions used in plotting:
(a) show()
(b) legend()
PyPlot
2 Likes
Answer
(a) show() — The purpose of the show()
function is to display the plot.
(b) legend() — The purpose of the legend()
function is to add a legend to the plot. In a chart/graph, there may be multiple datasets plotted. To distinguish among various datasets plotted in the same chart, legends are used. Legends can be different colors/patterns assigned to different specific datasets. The legends are shown in a corner of a chart/graph.
Answered By
1 Like
Related Questions
Write a Python program to plot the function y = x2 using the Matplotlib library.
Name the various methods used with pyplot object.
Plot a histogram of a class test of 40 students based on random sets of marks obtained by the students (MM=100).
A list namely temp contains average temperatures for seven days of last week. You want to see how the temperature changed in last seven days. Which chart type will you plot for the same and why ?