seaborn_Seaborn Distplot:综合指南

seaborn

Hey, folks! In this article, we will be focusing on Seaborn Distplot in detail.

嘿伙计! 在本文中,我们将重点关注Seaborn Distplot



什么是Seaborn Distplot? (What is a Seaborn Distplot?)

A Distplot or distribution plot, depicts the variation in the data distribution. Seaborn Distplot represents the overall distribution of continuous data variables.

一个Distplot或分布图,描绘了在数据分布的变化。 Seaborn Distplot代表连续数据变量的整体分布。

The Seaborn module along with the Matplotlib module is used to depict the distplot with different variations in it. The Distplot depicts the data by a histogram and a line in combination to it.

Seaborn模块与Matplotlib模块一起用于描述具有不同变体的distplot。 Distplot通过直方图和与其组合的线来描述数据。



创建海底Distplot (Creating a Seaborn Distplot)

Python Seaborn module contains various functions to plot the data and depict the data variations. The seaborn.distplot() function is used to plot the distplot. The distplot represents the univariate distribution of data i.e. data distribution of a variable against the density distribution.

Python Seaborn模块包含各种功能,可以绘制数据并描述数据变化。 seaborn.distplot() function用于绘制distplot。 分布图表示数据的单变量分布,即变量相对于密度分布的数据分布。

Syntax:

句法:


seaborn.distplot()

The seaborn.distplot() function accepts the data variable as an argument and returns the plot with the density distribution.

seaborn.distplot()函数接受数据变量作为参数,并返回具有密度分布的图。

Example 1:

范例1:


import numpy as np
import seaborn as sn
import matplotlib.pyplot as plt

data = np.random.randn(200)
res = sn.distplot(data)
plt.show()

We have used the numpy.random.randn() function to generate random data values. Further, the pyplot.show() function is used show the plot.

我们使用了numpy.random.randn() function来生成随机数据值。 此外,使用pyplot.show() function显示图。

Output:

输出:

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值