如何在python中按单个类别绘制分类图

2024-04-28 22:49:06 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一个分类列,它有5个类别,即[a,b,c,d,e] 我正试图用另一列(即x)构建一个绘图 我需要为每个类别建立一个单独的绘图 例如: A to X, B to x

{
g = sns.catplot(x="annual_inc", y="loan_status", hue="int_rate", col='purpose', data=loan, kind="bar", height=8, aspect=2);
}

我期待在enter image description here中的输出


Tags: to绘图ratestatus分类col类别hue