python - 使用 Seaborn `displot`(不是 `distplot`)在同一图表上绘制多个直方图
问题描述
Seaborndistplot
已被弃用。
我得到distplot
下图
使用此代码:
import matplotlib.pyplot as plt
import seaborn as sns
sns.distplot(random.normal(loc=177.8, scale=10.2, size=1000), kde=True)
sns.distplot(random.normal(loc=165.1, scale=8.9, size=1000), kde=True)
plt.show()
请问我如何达到同样的效果displot
?如果我只是替换displot
,distplot
则直方图将单独显示。
解决方案
您想使用 displot 有什么特别的原因吗?使用histplot
可以实现您的目标。
推荐阅读
- javascript - 将整个路径放入 d3.json
- ruby-on-rails - 将 after_update 与关联一起使用
- ios - 在归档我的应用程序时,我收到了 Realm 错误
- sql - XML AUTO 查询以 90 或更高的兼容模式返回派生表引用
- php - 使用 php-zip 是否有问题(作曲家对此提出警告)?
- pyspark - 获取 PySpark 数据框中每行的 null 数
- wordpress - 在我的插件 wordpress 主题中添加额外的注册字段
- javascript - 将 Polymer 3 路由更改为不同的 html 页面
- selenium - 我如何在不重复的情况下同时使用“When”和“And”来实现相同的功能
- vba - 查找和删除满足多个条件的重复项,同时在搜索中忽略自己的单元格