sns.set(style='darkgrid')
titanic = sns.load_dataset('titanic')
total = float(len(titanic))
ax = sns.countplot(x='class', hue='who', data=titanic)
for p in ax.patches:
    pass
How to add percentages on top of bars in seaborn?