I created a pretty simple stacked bar chart, but for some reason my x-tick labels are off centered. I tried using some tick.label.set_
properties to line them up be to no avail. Any suggestions? Thanks!
Code:
bottom = np.vstack((np.zeros((data.shape[1],), dtype=data.dtype), np.cumsum(data, axis=0) [:-1]))
for dat, col, bot, lab in zip(data, colors, bottom, labels):
ax1.bar(ind, dat, color=col, bottom = bot, alpha = .7, label = lab)
xticks([z for z in range(0,len(income_brackets))],[(str("{0:.0f}".format(k/1000)) + '-' + str("{0:.0f}".format(l/1000))) for k,l in income_brackets])
for tick in ax1.xaxis.get_major_ticks():
tick.label.set_fontsize(12)
tick.label.set_horizontalalignment('left')
Image: