1# Assume the rest of the code is written
2
3ax.set_yticklabels([]) # an empty list removes the labels
4country_names = top20_deathtoll['Country_Other']
5for i, country in zip(range(20), country_names):
6 ax.text(x=-80000, y=i-0.15, s=country)
1Axes.set_yticklabels() method.
2
3#code
4fig, ax = plt.subplots(figsize=(4.5, 6))
5ax.barh(top20_deathtoll['Country_Other'],
6 top20_deathtoll['Total_Deaths'],
7 height=0.45, color='#af0b1e')
8
9ax.set_yticklabels([]) #an empty list removes the labels
10
11#remove the current labels using for loop
12country_names = top20_deathtoll['Country_Other']
13for i, country in zip(range(20), country_names):
14 ax.text(x=-80000, y=i-0.15, s=country)
15
16