1. Home
  2. Data Science
  3. Matplotlib
  4. Which function is used to add a shape to a plot in…

Added 24 Feb 2024

Which function is used to add a shape to a plot in Matplotlib?

  1. plt.shape()
  2. plt.add_shape()
  3. plt.plot_shape()
  4. plt.add_patch() Correct answer

Correct answer

D. plt.add_patch()

17 views

MCQSEXAM

Explanation

Shapes such as rectangles, circles and polygons are "patches" in Matplotlib and are added with add_patch(), normally as ax.add_patch(Rectangle(...)) on an Axes object.

The classes are found in matplotlib.patches.

Want more practice? Try the full set of Data Science MCQs on MCQsExam.com.

Doubts & discussion

Not sure why the answer is D? 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