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

1. 分类散点图

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

方法1:

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

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

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

方法1:

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:

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

2. 分类分布图

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

方法1:

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:

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

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

方法1:

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:

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

(3)boxenplot(kind='boxen')

方法1:

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:

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

3. 分类估计图

(1)pointplot(kind='point')

方法1:

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:

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

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

方法1:

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:

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

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

方法1:

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:

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

  

posted @   nxf_rabbit75  阅读(918)  评论(0编辑  收藏  举报
编辑推荐:
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
阅读排行:
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 使用C#创建一个MCP客户端
· ollama系列1:轻松3步本地部署deepseek,普通电脑可用
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 按钮权限的设计及实现
1. 分类散点图(1)散点图striplot(kind='strip')(2)带分布的散点图swarmplot(kind='swarm')2. 分类分布图(1)箱线图boxplot(kind='box')(2)小提琴图violinplot(kind='violin')(3)boxenplot(kind='boxen')3. 分类估计图(1)pointplot(kind='point')(2)直方图barplot(kind='bar')(3)计数的直方图countplot(kind='count')
点击右上角即可分享
微信分享提示