多元双变量核密度估计kdeplot 核密度估计(kernel density estimation)是在概率论中用来估计未知的密度函数,属于非参数检验方法之一。通过核密度估计图可以比较直观的看出数据样本本身的分布特征。 f, ax = plt.subplots(figsize=(8, 8)) ax.set_aspect("equal") # 绘制等高线图来表示每一个二元密度 sns.kdeplot(...
sns.kdeplot(data=data, x="Product A Sales", label="Product A", shade=True) sns.kdeplot(data=data, x="Product B Sales", label="Product B", shade=True) # 添加标题和标签 plt.title("Distribution of Monthly Sales") plt.xlabel("Sales Amount") plt.ylabel("Density") # 添加图例 plt.le...
g = sns.PairGrid(df, diag_sharey=False) g.map_lower(sns.kdeplot) g.map_upper(sns.scatterplot) g.map_diag(sns.kdeplot, lw=3) residplot 线性回归残差图 #绘制模型残差 sns.set(style="whitegrid") # 使用以下示例数据集y ~ x rs = np.random.RandomState(7) x = rs.normal(2,1,75) y...
violinplot() 小提琴图 boxenplot() 增强箱图 pointplot() 点图 barplot() 条形图 countplot() 计数图 Distribution plot 分布图 jointplot() 双变量关系图 pairplot() 变量关系组图 distplot() 直方图,质量估计图 kdeplot() 核函数密度估计图 rugplot() 将数组中的数据点绘制为轴上的数据 Regression plots 回归...
4. Distribution plot options(distplot) 5. Timeseries plot with error bands(lineplot) 6. FacetGrid with custom projection(FacetGrid) 7. FacetGrid with custom projection(FacetGrid)
sns.displot(data, kind="hist", kde=True) plt.title("Normal Distribution") plt.show() 2. 热图 热图是一种用颜色编码矩阵数值的图表类型,通常用于显示相关性矩阵或者二维数据集。Seaborn 中的heatmap函数可以轻松地创建热图。下面是一个简单的示例,展示了一个相关性矩阵的热图: ...
# 创建数据 data = np.random.normal(size=100)# 创建直方图 sns.displot(data=data, bins=20, kde=True, color='green', biwidth=0.5, cumulative=False)# 添加标题 plt.title('Single Variable Distribution')# 添加轴标签 plt.xlabel('Value') plt.ylabel('Frequency')# 显示图表...
1.1 scatterplot(散点图) 1.2 lineplot(线图) 1.3 relplot(关系图) 2.Categorical plots(分类图) 2.1 Categorical scatterplots(分类散点图) 2.1.1 stripplot(分布散点图) 2.1.2 swarmplot(分布密度散点图) 2.2 Categorical distribution plots(分类分布图) ...
3. Hexbin plot with marginal distributions(jointplot) rs=np.random.RandomState(11)x=rs.gamma(2,size=1000)y=-.5*x+rs.normal(size=1000)# 边界核密度估计图 kind选择类型sns.jointplot(x,y,kind="hex",color="#4CB391"); 4. Horizontal bar plots(barplot) ...
Distribution plot 分布图 jointplot() 双变量关系图 pairplot() 变量关系组图 distplot() 直方图,质量估计图 kdeplot() 核函数密度估计图 rugplot() 将数组中的数据点绘制为轴上的数据 Regression plots 回归图 lmplot() 回归模型图 regplot() 线性回归图 ...