Matplotlib 3.4.2 has a function called bar_label that makes it easier to add data labels to bar charts. I have data in decimal form (e.g. 0.9783), and I want to use bar_label to create data labels in percentage form and rounded to the nearest unit (e.g. 98%).
bar_label has a fmt variable, but I'm not sure what to enter in order to format the numbers as rounded percentages. Normally, I would use {:.0%}'.format(0.9786) to arrive at 98% (per this documentation), but this formatting doesn't work with bar_label. Is there another method I could use instead?
The bar_label code will resemble: ax.bar_label(bars,fmt='[Not sure what to put here]')