Informatics Practices
Given the following set of data :
Weight measurements for 16 small orders of French-fries (in grams).
78 72 69 81 63 67 65 75
79 74 71 83 71 79 80 69
Create a horizontal histogram from the above data.
PyPlot
1 Like
Answer
import matplotlib.pyplot as plt
weights = [78, 72, 69, 81, 63, 67, 65, 75, 79, 74, 71, 83, 71, 79, 80, 69]
plt.hist(weights, orientation = 'horizontal')
plt.title('Weight Distribution of French Fries Orders')
plt.show()
Output

Answered By
1 Like
Related Questions
Navya has started an online business. A list stores the number of orders in last 6 months. Write a program to plot this data on a horizontal bar chart.
Given the following set of data :
Weight measurements for 16 small orders of French-fries (in grams). 78 72 69 81 63 67 65 75 79 74 71 83 71 79 80 69Create a simple histogram from the above data.
Given the following set of data :
Weight measurements for 16 small orders of French-fries (in grams). 78 72 69 81 63 67 65 75 79 74 71 83 71 79 80 69Create a step type of histogram from the above data.
Given the following set of data :
Weight measurements for 16 small orders of French-fries (in grams). 78 72 69 81 63 67 65 75 79 74 71 83 71 79 80 69Create a cumulative histogram from the above data.