This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Function to print digits on top of Barplot | |
def show_values(axs, orient="v", space=.01): | |
def _single(ax): | |
if orient == "v": | |
for p in ax.patches: | |
_x = p.get_x() + p.get_width() / 2 | |
_y = p.get_y() + p.get_height() + (p.get_height()*0.01) | |
value = '{:.2f}'.format(p.get_height()) | |
ax.text(_x, _y, value, ha="center") | |
elif orient == "h": |