使用seaborn在python中,如何将数字放在多图上?
我想将图1的%复制到多图图(图2)
图1的代码
import seaborn as sns
sns.barplot(y='y', x='x', data=df, color='black')
for i in ax.patches:
# get_x pulls left or right; get_height pushes up or down
ax.text(i.get_x()+0.2, i.get_height()+.001, \
str(round((i.get_height())*100, 1))+'%', fontsize=20,
color='dimgrey')
图2的代码
import seaborn as sns
sns.factorplot(y='y', x='x', col='z', data=df, color='black',kind='bar')