plt.bar(left=left, height=0.8, width=value, bottom=bottoms, color=color,
    orientation='horizontal', label=name)
plt.yticks(bottoms + 0.4, [('data %d' % (t + 1)) for t in bottoms])
plt.legend(loc='best', bbox_to_anchor=(1.0, 1.0))
plt.subplots_adjust(right=0.85)
plt.show()
Stacked bar chart with differently ordered colors using matplotlib