I have a problem with a displayed bar_label and I could not find an answer to my questions regarding the format. I simply want to display the bar_label as percent. Instead of 0.45 I want it to show 45%. Was able to change the y-axis format without a problem but not the bar_label one.
I have played around with the fmt part of bar_label but was not able to solve my problem.
Any help is appreciated!
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.ticker as mtick
A = [0.45, 0.17, 0.47]
fig, ax = plt.subplots()
X=['1', '2', '3']
hbars = ax.bar(X, A, width, color = "b")
ax.bar_label(hbars)
ax.set_ylim(0,0.55)
ax.yaxis.set_major_formatter(mtick.PercentFormatter(1.0))
