data = [1,2,2,2,2,2,3,4,5,6,6,6,6,7,8,9,8,6,3]
plt.hist(data)
plt.xlabel('Value')
plt.ylabel('Number of appearances (count)')
plt.show()
# histdata = np.histogram(data,bins=np.arange(1,11))
y,x = np.histogram(data,bins=np.arange(1,11))
print(np.arange(1,11))
# print(histdata)
# print(histdata[1][:-1])
# plt.bar(histdata[1][:-1],histdata[0])
plt.bar(x[:-1],y)
plt.xlabel('Value')
plt.ylabel('Number of appearances (count)')
plt.show()
yp = y/np.sum(y)
plt.bar(x[:-1],yp)
plt.xlabel('Value')
plt.ylabel('Proportion')
plt.xticks(np.arange(1,10))
plt.show()
yp = y/np.max(y)
plt.bar(x[:-1],yp)
plt.xlabel('Value')
plt.ylabel('Proportion (norm.)')
plt.xticks(np.arange(1,10))
plt.show()