CBSE Class 12 Informatics Practices Question 32 of 73

Data Visualization using Matplotlib — Question 9

Back to all questions
9
Question

Question 9

Which of the following is an incorrect example of savefig() function?

  1. plt.savefig("bar1.pdf" )
  2. plt.savefig("bar1.png")
  3. plt.savefig("bar1.eps")
  4. plt.savefig("bar1.ppt")
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.