I am trying to add two tiers of labels to this stacked grouped barplot using matplotlib. Each bar in each respective position of each group should have the same label (i.e. the first bar in each group should be labeled "1", the second bar in each group "2", etc.). Then I would like there to be a second tier of labels for each group. So far, this is what I have:
width = 0.25
x = np.arange(1, 7)
fig = plt.figure(figsize=(10,6))
ax = plt.axes()
ax.bar(x-0.4, shift1_rbc, width, color='red', tick_label='1')
ax.bar(x-0.1, shift2_rbc, width, color='red')
ax.bar(x+0.2, shift3_rbc, width, color='red')
ax.bar(x-0.4, shift1_plt, width*.7, color='blue')
ax.bar(x-0.1, shift2_plt, width*.7, color='blue')
ax.bar(x+0.2, shift3_plt, width*.7, color='blue')
ax.bar(x-0.4, shift1_ffp, width*.5, color='green')
ax.bar(x-0.1, shift2_ffp, width*.5, color='green')
ax.bar(x+0.2, shift3_ffp, width*.5, color='green')
When I try to add a "tick_label" parameter to another set of bars, it replaces the previous label, like so:
width = 0.25
x = np.arange(1, 7)
fig = plt.figure(figsize=(10,6))
ax = plt.axes()
ax.bar(x-0.4, shift1_rbc, width, color='red', tick_label='1')
ax.bar(x-0.1, shift2_rbc, width, color='red', tick_label='1')
ax.bar(x+0.2, shift3_rbc, width, color='red')
ax.bar(x-0.4, shift1_plt, width*.7, color='blue')
ax.bar(x-0.1, shift2_plt, width*.7, color='blue')
ax.bar(x+0.2, shift3_plt, width*.7, color='blue')
ax.bar(x-0.4, shift1_ffp, width*.5, color='green')
ax.bar(x-0.1, shift2_ffp, width*.5, color='green')
ax.bar(x+0.2, shift3_ffp, width*.5, color='green')
I appreciate any help anyone can provide!