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

Added 24 Feb 2024

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

  1. To create a staircase plot
  2. To create a step plot with constant values between points Correct answer
  3. To create a bar plot
  4. To create a line plot with linear interpolation

Correct answer

B. To create a step plot with constant values between points

15 views

MCQSEXAM

Explanation

plt.stairs() draws a step plot with constant values between edges. You pass the values and the bin edges, which makes it ideal for showing pre-computed histograms.

It was added in Matplotlib 3.4 as a simpler alternative to plt.step().

Keep preparing with more Data Science MCQs 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