left align the y tick labels 7c remove the current labels

Solutions on MaxInterview for left align the y tick labels 7c remove the current labels by the best coders in the world

showing results for - "left align the y tick labels 7c remove the current labels"
Claudia
28 Jan 2017
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)
Dylan
03 Jan 2019
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    
similar questions