Here is my original code:
categories = df[(df['Title'].isin(Titles_top10))].groupby('Title').agg(np.sum).drop(['Regular', 'Total'], axis=1)
generate horizontal stacked bar chart(s)
fig, ax = plt.subplots()
categories.plot.barh(stacked=True, rot=0, ax=ax)
ax.set_title('Total expenditure by earnings category\n(excluding \"regular\" and \"total")')
ax.set_ylabel('Total Expenditure')
handles, labels = ax.get_legend_handles_labels()
ax.legend(handles[::-1], labels[::-1], prop={'size': 'small'},bbox_to_anchor=(1, 1.05))
plt.tight_layout()
plt.show()
But I want to change it to Stacked Percentage Bar Plot. How should I do that?