i want generate text with the same spacing as y-ticks in matplotlib
Failed to reach by axes.bar_label
my code
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
sns.set_style('white')
s = pd.Series({'John': 5, 'Amy': 7, 'Elizabeth': 6, 'James': 10, 'Roy': 5})
ax1 = s.plot(kind='barh', figsize=(6, 3), width=.1)
labels = ax1.bar_label(ax1.containers[0], fontsize=10)
for label in labels:
label.set_ha('right')
ax1.set_xticks([])
sns.despine(bottom=True, left=True)
i want generate 6 text with the same spacing as y-ticks in matplotlib
ex. The 6 texts are positioned 0.1 (based on transAxes) above their respective yticks