使用python x和y数字以及n个分类变量绘制kde或直方图

时间:2018-10-11 15:50:11

标签: python plot histogram seaborn kde

对不起,如果这很容易,我就这样绘制了一个散点图:

col1 =客户['年龄'] col2 = customer ['AveMonthSpend']

def plot_iris(customer, col1, col2):
    sns.lmplot(x = col1, y = col2, 
               data = customer, 
               hue = "Gender", 
               fit_reg = False)
    plt.xlabel(col1)
    plt.ylabel(col2)
    #plt.title('Iris species shown by color')
    plt.show()
plot_iris(customer, 'Age', 'AveMonthSpend')

我想根据一列的唯一值绘制直方图或kde值,分别带有x和y数字轴以及n个分类,例如在其男性或女性的上方。请帮忙。谢谢。

凯文

0 个答案:

没有答案