1. Home
  2. Data Science
  3. Matplotlib
  4. What function is used to set the aspect ratio of a plot in…

Added 24 Feb 2024

What function is used to set the aspect ratio of a plot in Matplotlib?

  1. plt.aspect()
  2. plt.set_aspect() Correct answer
  3. plt.set_ratio()
  4. plt.set_aspect_ratio()

Correct answer

B. plt.set_aspect()

14 views

MCQSEXAM

Explanation

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.

Doubts & discussion

Not sure why the answer is B? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Matplotlib MCQs

Practise all Matplotlib MCQs

Similar MCQs