1. Home
  2. Data Science
  3. Matplotlib
  4. What is the purpose of the plt.fill_between() function in…

Added 24 Feb 2024

What is the purpose of the plt.fill_between() function in Matplotlib?

  1. To fill the area between two horizontal curves Correct answer
  2. To fill the area between two vertical curves
  3. To fill the area between two scatter plots
  4. To fill the area under a line plot

Correct answer

A. To fill the area between two horizontal curves

16 views

MCQSEXAM

Explanation

plt.fill_between() fills the area between two curves defined over the same x-values (or between one curve and a baseline).

It is commonly used for confidence bands and for shading the area under a line. fill_betweenx() is the version for curves defined over y-values.

For more solved questions like this one, see Data Science MCQs on MCQsExam.com.

Doubts & discussion

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