value text on bar charts

PHOTO EMBED

Thu Mar 11 2021 09:50:49 GMT+0000 (Coordinated Universal Time)

Saved by @Ariendal #python #pandas

for p in ax.patches:
    values = '{:.0f}'.format(p.get_height())
    x = p.get_x() + p.get_width()/2
    y = p.get_height()
    ax.annotate(values, (x, y),ha='center', va ='bottom', fontsize = 10)
content_copyCOPY