Hi Sahil,
Thanks so much for sharing the guided project. I have a question. Can you please explain to me what is going on in this statement:
ax = plt.barh(*zip(*d.items()), height=.5)
Basically, this part of the code has me really stumped
rectangles = ax.patches
for rectangle in rectangles:
x_value = rectangle.get_width()
y_value = rectangle.get_y() + rectangle.get_height() / 2
space = 5
ha = 'left'
label = "{}".format(x_value)
if x_value > 0:
plt.annotate(
label,
(x_value, y_value),
xytext=(space, 0),
textcoords="offset points",
va='center',
ha=ha)
axes.tick_params(tick1On=False)
Thank you!