在matplotlib中绘制直方图的值

时间:2016-12-20 13:39:59

标签: python matplotlib

我需要使用matplotlib创建一个直方图,使用提供的值而不是频率来决定条形的高度。

Eg-list = [27,28,13,56,43]包含选择特定主题的人。

应该生成一个直方图,其y轴上的值为27,28,13,56,43(或者值范围为0-10,10-20 ......),并且在x轴上,其名称为因为我是新手,我不知道该怎么办?

pylab.xlabel("Topics")
bins=range(0,100,1)
pylab.ylabel("Number of people interested")
pylab.hist(result,bins)

结果

histogram divided with frequencies

请帮助

0 个答案:

没有答案