Informatics Practices
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 simple histogram from the above data.
PyPlot
1 Like
Answer
import matplotlib.pyplot as plt
weights = [78, 72, 69, 81, 63, 67, 65, 79, 74, 71, 83, 71, 79, 80]
plt.hist(weights)
plt.title('Weight Distribution of muffins')
plt.show()
Output

Answered By
1 Like
Related Questions
What are various types of histograms that can be created through hist() function ?
When should you create histograms and when should you create bar charts to present data visually ?
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, 80Create a horizontal histogram from the above data.
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, 80Create a step type of histogram from the above data.