I have the following code:
fig, ax = plt.subplots()
single_customer_g['Size_GB'] = round(single_customer_g['Size_GB'] / 1024, 2)
single_customer_g = single_customer_g.pivot('Date', 'Vault', 'Size_GB')
single_customer_g.plot.bar(stacked=True, rot=1, figsize=(15, 10), ax=ax, zorder=3)
for c in ax.containers:
labels = [round(v.get_height(), 2) if v.get_height() > 0 else 0 for v in c]
ax.bar_label(c, labels=labels, label_type='center')
I am trying to add total figure as a label on top of each column, but just can't figure it out. i tried multiple examples, and nothing is working so far.