Label a bar plot.
Adds labels to bars in the given BarContainer
. You may need to adjust the axis limits to fit the labels.
BarContainer
Container with all the bars and optionally errorbars, likely returned from bar
or barh
.
A list of label texts, that should be displayed. If not given, the label texts will be the data values formatted with fmt.
A format string for the label.
The label type. Possible values:
Distance of label from the end of the bar, in points.
Any remaining keyword arguments are passed through to Axes.annotate
.
matplotlib.axes.Axes.bar_label
© 2012–2021 Matplotlib Development Team. All rights reserved.
Licensed under the Matplotlib License Agreement.
https://matplotlib.org/3.5.1/api/_as_gen/matplotlib.axes.Axes.bar_label.html