Hi guys!
So I've this image :
What I trying to do if to leave 'H37Rv' only in the purple bar.
My code is the following:
rects = ax.bar(ind, num, width, color=colors)
for rect in rects:
height = int(rect.get_height())
if height < 5:
yloc = height + 2
clr = '#182866'
else:
yloc = height / 2.0
clr = '#182866'
p = 'H37Rv'
xloc = rect.get_x() + (rect.get_width() / 2.0)
ax.text(xloc, yloc, p, horizontalalignment='center', verticalalignment='center', color=clr, weight='bold')
I also tried this:
for rect in rects:
if color == purple:
height = int(rect.get_height())
if height < 5:
yloc = height + 2
clr = '#182866'
but I get an error saying color is not defined.
Anyone has any idea how to solve this?
Thanks a lot!