我的图表中yaxis
的范围是-3
到3
。有谁知道如何修改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()
答案 0 :(得分:0)
ax.spines['bottom'].set_position('zero')
ax.set_xticklabels(labels, rotation = -90