What function is used to set the aspect ratio of a plot in Matplotlib?
Correct answer
B. plt.set_aspect()
14 views
B. plt.set_aspect()
14 views
set_aspect() sets the aspect ratio. It is normally called on an Axes object: ax.set_aspect("equal") makes one unit on x the same length as one unit on y.
With pyplot alone, plt.gca().set_aspect("equal") or plt.axis("equal") does the same.
Practise more Data Science MCQs with answers and explanations on MCQsExam.com.
Not sure why the answer is B? Ask here and get an explanation.