在y = 0

时间:2015-06-25 15:02:52

标签: python matplotlib axis axis-labels

我的图表中yaxis的范围是-33。有谁知道如何修改xticks或其对应的xtick labels,以便它们显示在y=0级别?

由于

ind = np.arange(len(labels))
width = 0.4
width2 = 0.73
width3 = .85

fig, ax = plt.subplots(figsize=(12,5), facecolor='white')

application = ax.bar(ind, values3, width3, color = 'g', alpha = .25)
admit = ax.bar(ind+((width3-width2)/2), values2, width2, color = '#537DDE', alpha = .6)
matric = ax.bar(ind+((width3-width)/2), values, width, color = '#E13F2A', alpha = .9)

ax.set_axis_bgcolor('white')
plt.xticks(ind)
ax.set_xticklabels(labels, rotation = -90)
ax.set_xticks(ind+(width/2))
plt.show()

1 个答案:

答案 0 :(得分:0)

ax.spines['bottom'].set_position('zero') ax.set_xticklabels(labels, rotation = -90