• seaborn类别图---catplot 、分类散点图stripplot/swarmplot、分类分布图boxplot/boxplot/boxenplot、分类估计图pointplot/barplot/countplot


    1. 分类散点图

    (1)散点图striplot(kind='strip')

    方法1:

    seaborn.stripplot(x=None, y=None, hue=None, data=None, order=None, hue_order=None, jitter=True, dodge=False, orient=None, color=None, palette=None, size=5, edgecolor='gray', linewidth=0, ax=None, **kwargs)

    方法2:catplot的kind默认=striplot

    sns.catplot(x="sepal_length", y="species", data=iris)

    (2)带分布的散点图swarmplot(kind='swarm'

    方法1:

    seaborn.swarmplot(x=None, y=None, hue=None, data=None, order=None, hue_order=None, dodge=False, orient=None, color=None, palette=None, size=5, edgecolor='gray', linewidth=0, ax=None, **kwargs)

    方法2:

     sns.catplot(x="sepal_length", y="species", kind="swarm", data=iris)   

    2. 分类分布图

    (1)箱线图boxplot(kind='box'

    方法1:

    seaborn.boxplot(x=None, y=None, hue=None, data=None, order=None, hue_order=None, orient=None, color=None, palette=None, saturation=0.75, width=0.8, dodge=True, fliersize=5, linewidth=None, whis=1.5, notch=False, ax=None, **kwargs)

    方法2:

    sns.catplot(x="sepal_length", y="species", data=iris)

    (2)小提琴图violinplot(kind='violin'

    方法1:

    seaborn.violinplot(x=None, y=None, hue=None, data=None, order=None, hue_order=None, bw='scott', cut=2, scale='area', scale_hue=True, gridsize=100, width=0.8, inner='box', split=False, dodge=True, orient=None, linewidth=None, color=None, palette=None, saturation=0.75, ax=None, **kwargs)

    方法2:

    sns.catplot(x="sepal_length", y="species", kind="violin", data=iris)

    (3)boxenplot(kind='boxen')

    方法1:

    seaborn.boxenplot(x=None, y=None, hue=None, data=None, order=None, hue_order=None, orient=None, color=None, palette=None, saturation=0.75, width=0.8, dodge=True, k_depth='proportion', linewidth=None, scale='exponential', outlier_prop=None, ax=None, **kwargs)

    方法2:

    sns.catplot(x="species", y="sepal_length", kind="boxen", data=iris)

    3. 分类估计图

    (1)pointplot(kind='point')

    方法1:

    seaborn.pointplot(x=None, y=None, hue=None, data=None, order=None, hue_order=None, estimator=<function mean>, ci=95, n_boot=1000, units=None, markers='o', linestyles='-', dodge=False, join=True, scale=1, orient=None, color=None, palette=None, errwidth=None, capsize=None, ax=None, **kwargs)

    方法2:

    sns.catplot(x="sepal_length", y="species", kind="point", data=iris)

    (2)直方图barplot(kind='bar'

    方法1:

    seaborn.barplot(x=None, y=None, hue=None, data=None, order=None, hue_order=None, estimator=<function mean>, ci=95, n_boot=1000, units=None, orient=None, color=None, palette=None, saturation=0.75, errcolor='.26', errwidth=None, capsize=None, dodge=True, ax=None, **kwargs)

    方法2:

    sns.catplot(x="sepal_length", y="species", kind="bar", data=iris)

    (3)计数的直方图countplot(kind='count'

    方法1:

    seaborn.countplot(x=None, y=None, hue=None, data=None, order=None, hue_order=None, orient=None, color=None, palette=None, saturation=0.75, dodge=True, ax=None, **kwargs)

    方法2:

    sns.catplot(x="species", kind="count", data=iris)
    

      

  • 相关阅读:
    git commit --amend
    webpack代码分割
    selection And range js
    自动化测试
    python学习路线图
    Java--解决JDK14没有jre问题
    Java-win下环境变量设置
    Jenkins忘记admin密码拯救方法
    Windows或linux下 pip设置默认豆瓣镜像源
    ChromeDriver与Chrome版本对应参照表及ChromeDriver下载链接
  • 原文地址:https://www.cnblogs.com/nxf-rabbit75/p/12097756.html
Copyright © 2020-2023  润新知