nschloe / matplotx

:bar_chart: More styles and useful extensions for Matplotlib

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bar labels when bar is too short

RemDelaporteMathurin opened this issue · comments

Sometimes when using show_bar_values(alignemnent="horizontal") and the bar is too small this can happen:
image

The expected behaviour would be:
image

Same for verticals I guess.

True! A simple post-processing of the texts checking if the bounding box of the annotation is greater than the width of the rectangle does the trick.

I'll try to find time to implement this :-)