Which method is used to save a Matplotlib figure to a file?
Correct answer
C. savefig()
16 views
C. savefig()
16 views
savefig() saves a Matplotlib figure to a file. It can be called as plt.savefig("plot.png") or on a figure object as fig.savefig(...).
Useful options include dpi for resolution and bbox_inches="tight" to trim margins.
For more solved questions like this one, see Data Science MCQs on MCQsExam.com.
Not sure why the answer is C? Ask here and get an explanation.