将Seaborn Factorplot y标签格式化为百分比

时间:2018-04-09 18:49:57

标签: matplotlib format seaborn

我试图将y-ticks更改为下图中的百分比。 y变量目前是0和1的平均值。有没有办法将格式调整为factorplot中的百分比?

plt.figure(figsize = (10, 7))
sns.factorplot(x="groups", y="has_invoice", hue = 'kind', 
    x_estimator=np.mean, data=df[df['app'] != 'other, other, web'], 
    order = ['< 2', '2-4', '4-6', '6-8', '8-10', '10-12', '12-14', '14- 
    16', '>16'], size=7, aspect=1)
plt.xlabel('#')
plt.title('')
plt.ylabel('Rate (#Has Invoices / #Total Count)', fontsize = 15)

Can't upload an image yet but it should be attached here!

0 个答案:

没有答案