Seaborn distplot:具有多个kdeplots的y轴问题 [英] Seaborn distplot: y axis problems with multiple kdeplots

查看:49
本文介绍了Seaborn distplot:具有多个kdeplots的y轴问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在同一张图上绘制 3 个核密度估计值.我假设kdeplots使用相对频率作为y值,但是对于我的某些数据,kdeplot的频率远高于1.

I am currently plotting 3 kernel density estimations together on the same graph. I assume that kdeplots use relative frequency as the y value, however for some of my data the kdeplot has frequencies way above 1.

我正在使用的代码:

sns.distplot(data1, kde_kws={"color": "b", "lw": 1.5, "shade": "False",  "kernel": "gau", "label": "t"}, hist=False)

有谁知道我如何确保 kdeplot 要么使 y 值相对频率,要么允许我将 ymax 轴限制自动调整到计算的最大频率?

Does anyone know how I can make sure that the kdeplot either makes y value relative frequency, or allow me to adjust the ymax axis limit automatically to the maximum frequency calculated?

推荐答案

好的,所以我想我只需要将自动缩放设置为 Tight,这样它就不会给出负值规模.

Okay so I figured out that I just needed to set the autocaling to Tight, that way it didn't give negative values on the scale.

这篇关于Seaborn distplot:具有多个kdeplots的y轴问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆