seaborn distplot 用法

1. 介绍

seaborn.distplot(a, bins=None, hist=True, kde=True, rug=False, fit=None, hist_kws=None, 
kde_kws=None, rug_kws=None, fit_kws=None, color=None, vertical=False, norm_hist=False, 
axlabel=None, label=None, ax=None)

其中,
a : 序列Series或列表或1维数组;
bins : 直方图桶的个数;
hist : bool, optional,是否绘制直方图;
color : matplotlib color, optional;
label : string, optional,说明的标签;
ax : matplotlib axis, optional;
kde : bool, optional,Whether to plot a gaussian kernel density estimate.
rug : bool, optional,Whether to draw a rugplot on the support axis.
fit : random variable object, optional;An object with fit method, returning a tuple that can be passed to a pdf method a positional arguments following an grid of values to evaluate the pdf on.

vertical : bool, optional;If True, observed values are on y-axis.
norm_hist : bool, optional
If True, the histogram height shows a density rather than a count. This is implied if a KDE or fitted density is plotted.
axlabel : string, False, or None, optional
Name for the support axis label. If None, will try to get it from a.namel if False, do not set a label.

2. 使用

示例1:

import seaborn as sns,numpy as np
sns.set()
np.random.seed(0)
x=np.random.randn(100)
ax=sns.distplot(x)

效果:

在这里插入图片描述


示例2:

ax = sns.distplot(x, fit=norm, kde=False)

在这里插入图片描述


reference:

  1. seaborn tutorials
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

rosefunR

你的赞赏是我创作的动力!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值