Thursday, 11 March 2021

Class 12 IP Practical - 03

 

 WAP in Python to compare the sugar levels among men and women in a city using histogram.

Men:[113,85,90,150,149,88,93,115,135,80,77,82,129]

Women:[67,98,120,133,150,84,69,89,79,120,112,100]

bins:[80,100,125,150]


import matplotlib.pyplot as plt


Men=[113,85,90,150,149,88,93,115,135,80,77,82,129]

Women=[67,98,120,133,150,84,69,89,79,120,112,100]

bins=[80,100,125,150]

plt.hist([Men,Women],bins)

plt.xlabel("Intervals")

plt.ylabel("Number of Person")

plt.title("Histogram Chart")

plt.show()







No comments:

Post a comment