【发布时间】:2018-01-21 23:19:52
【问题描述】:
我需要使直方图的条居中。
x = array
y = [0,1,2,3,4,5,6,7,8,9,10]
num_bins = len(array)
n, bins, patches = plt.hist(x, num_bins, facecolor='green', alpha=0.5)
barWidth=20
x.bar(x, y, width=barWidth, align='center')
plt.show()
我需要的是,它看起来像 this picture 中的那个
我几乎尝试了所有方法,但仍然无法通过。 谢谢大家
【问题讨论】:
标签: python alignment histogram