CBSE Class 12 Informatics Practices Question 114 of 147

Plotting with Pyplot — Question 14

Back to all questions
14
Question

Question 14

What is cumulative histogram ? How do you create it using PyPlot ?

Answer

A cumulative histogram is a graphical representation in which each bin displays the count of data points within that bin as well as the counts of all smaller bins. The final bin in this histogram indicates the total number of data points in the dataset.

In Matplotlib's hist function, we can create a cumulative histogram by setting the cumulative parameter to True. The syntax is as follows: matplotlib.pyplot.hist(x, bins = None, histtype='barstacked', cumulative=True).