Q. Out of above plotted histograms, which ones can be used for creating frequency polygons? Can you draw frequency polygons from all the above histograms ?
Answer :-
We can use step type of histogram to make frequency polygons.
By following script :-
import matplotlib.pyplot as plt x=[78 ,72, 69 ,81 ,63 ,67 ,65 ,75 ,79 ,74 ,71, 83 ,71 ,79 ,80 ,69 ] a,bins,c=plt.hist(x,bins=7,histtype='step') l=list(bins) l.insert(0,0) l.insert(len(bins)+1,bins[len(bins)-1]) mid=[] for i in range(len(l)-1): ele=(l[i]+l[i+1])/2 mid.append(ele) x=list(a) x.insert(0,0) x.insert(len(a)+1,0) plt.plot(mid,x,'go--') plt.xlabel("Age") plt.show()
Output :-
Post a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )