Informatics Practices
Which of the following is an incorrect example of savefig() function?
- plt.savefig("bar1.pdf" )
- plt.savefig("bar1.png")
- plt.savefig("bar1.eps")
- plt.savefig("bar1.ppt")
PyPlot
2 Likes
Answer
plt.savefig("bar1.ppt")
Reason — The savefig() function in matplotlib is used to save a figure to a file. It supports various file formats such as PDF, PNG, EPS, SVG, etc. However, PPT (PowerPoint) is not a supported file format for saving figures in matplotlib.
Answered By
3 Likes
Related Questions
Which of the following statements is used to create a histogram of 'step' type with 20 bins?
- plt.hist(x, bins = 20, histtype = "barstacked")
- plt.hist(x, bins=20)
- plt.hist(x, bins=20, histtype="step")
- plt.hist(x, bins=20, histtype=hist())
The part of chart which identifies different sets of data plotted on plot by using different colors is called:
- legends
- title
- axes
- figure
Which of the following plots makes it easy to visualize a trend in data over intervals of time.
- Box plot
- Histogram
- Line Chart
- Bar chart
COVID-19 patient analysis in the Mumbai region is to be plotted. The command used to give title to X-axis as "No. of Patients" in the graph is:
- plt.show()
- plt.plot("No. of Patients")
- plt.xlabel("No. of Patients")
- plt.title("No. of Patients")