fix warning and cleanup
This commit is contained in:
@@ -38,8 +38,9 @@ def show_values_on_bars(ax, label):
|
|||||||
for i, p in enumerate(ax.patches):
|
for i, p in enumerate(ax.patches):
|
||||||
x = p.get_x() + p.get_width() * 0.9
|
x = p.get_x() + p.get_width() * 0.9
|
||||||
y = p.get_y() + p.get_height() / 2
|
y = p.get_y() + p.get_height() / 2
|
||||||
value = '{:.0%}'.format(label[i])
|
# Species confidence
|
||||||
# Uncomment for Species Count Total
|
# value = '{:.0%}'.format(label.iloc[i])
|
||||||
|
# Species Count Total
|
||||||
value = '{:n}'.format(p.get_width())
|
value = '{:n}'.format(p.get_width())
|
||||||
bbox = {'facecolor': 'lightgrey', 'edgecolor': 'none', 'pad': 1.0}
|
bbox = {'facecolor': 'lightgrey', 'edgecolor': 'none', 'pad': 1.0}
|
||||||
ax.text(x, y, value, bbox=bbox, ha='center', va='center', size=9, color='darkgreen')
|
ax.text(x, y, value, bbox=bbox, ha='center', va='center', size=9, color='darkgreen')
|
||||||
|
|||||||
Reference in New Issue
Block a user