question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Adding axis bar_label() to sns.barplot BarContainer with error bars doesn't put labels above error bars

See original GitHub issue

In matplotlib when you call ax.bar_label(bar, labels=[...]) on a BarContainer which has error bars it will put the labels correctly above the error bars. But in seaborn it’s putting it above the bars but not the error bars.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mwaskomcommented, Mar 2, 2022

If you search on stackoverflow you will find approximately one thousand questions asking how to put labels over a bar plot.

0reactions
hermidalccommented, Mar 2, 2022

If you search on stackoverflow you will find approximately one thousand questions asking how to put labels over a bar plot.

Thank you, for others who come here with the same problem, I found good examples below, where they used seaborn barplot and matplotlib annotate. Works great and you can put the labels as high or low as you want.

https://www.geeksforgeeks.org/how-to-annotate-bars-in-barplot-with-matplotlib-in-python/

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to add value labels on a bar chart? - python
Firstly freq_series.plot returns an axis not a figure so to make my answer a little more clear I've changed your given code to...
Read more >
Axes.bar_label
Label a bar plot. Adds labels to bars in the given BarContainer . You may need to adjust the axis limits to fit...
Read more >
[Bug]: bar_label overlaps bars when y-axis is inverted · ...
In this case, the label will overlap the borders and could significantly hinder the display. I think that the alignment should be handled ......
Read more >
How To Annotate Barplot with bar_label() in Matplotlib
Here we add bar height as bar labels to make it easy to read the barplot. plt.figure(figsize=(8, 6)) splot=sns.barplot(x="continent",y="lifeExp" ...
Read more >
How to obtain a correct legend for a barplot when the first ...
When I add a legend, it always takes the colors from the first bars. ... plt.bar(..., label='label') the label gets assigned to the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found