CBSE Class 12 Informatics Practices Question 61 of 73

Data Visualization using Matplotlib — Question 26

Back to all questions
26
Question

Question 23(iv)

Given the following set of data:

Weight measurements for 14 values of muffins (in grams)

78, 72, 69, 81, 63, 67, 65
79, 74, 71, 83, 71, 79, 80

Create a cumulative histogram from the above data.

Answer
import matplotlib.pyplot as plt
weights = [78, 72, 69, 81, 63, 67, 65, 79, 74, 71, 83, 71, 79, 80]
plt.hist(weights, cumulative = True)
plt.title('Weight Distribution of muffins')
plt.show()
Output
Given the following set of data: Weight measurements for 14 values of muffins (in grams). Data Visualization using Matplotlib, Informatics Practices Preeti Arora Solutions CBSE Class 12