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:
    height = p.get_height()
ax.text(p.get_x() + p.get_width() / 2.0, height + 3, '{:1.2f}'.format(
    height / total), ha='center')
show()
How to add percentages on top of bars in seaborn?