我想对matplotlib条标签中的only 1 bar label
个应用不同的格式.
Example Code
import pandas as pd
import seaborn as sns
sns.set_style('white')
s = pd.Series({'John': 10000, 'Amy': 5000, 'Elizabeth': 2000, 'James': 3000, 'Roy': 4000})
color1 = ['orange', 'lightgrey', 'lightgrey','lightgrey','lightgrey']
ax1 = s.plot(kind='barh', color=color1, figsize=(6, 3), width=.8)
labels = ax1.bar_label(ax1.containers[0], padding=-10, color='black', fontsize=10)
for label in labels:
label.set_ha('right')
ax1.set_xticks([])
sns.despine(bottom=True, left=True)
我想将John ' swine 吧标签改为20号,粗体,白色.
也想利用s.index
来瞄准约翰.
我应该使用哪个代码?
感谢您的帮助!