您可以像这样创建条形图:
from matplotlib.pyplot import *
x = [111,122,155,192,11,123,120,]
y = [3,4,3,5,9,10,23]
bar(x,y)
show()
gives:
Using hist()
bins your data for you, so you would pass it your raw data, ie. it would look like this:
data = [111, 111, 111, 122, 122, 122, 122, 155, ...]