当包含在Seaborn PairGrid中时,为什么kdeplot会缩小y轴?

时间:2017-10-17 19:08:32

标签: python pandas matplotlib seaborn

我必须follow the instructions posted here创建一个散点图矩阵,该矩阵使用多种颜色来区分我的数据集中的处理(this seems to still be on open issue)。

我的问题是我的一些kde子图离开了y轴刻度:Leaf area index PairGrid

使用“Iris”数据集的问题似乎并不严重,但我仍然看到它发生在第2,第3和第4个子图(see the PairGrid in this post)。

如何调整y轴刻度以使我的所有kde数据都适合子块?

import matplotlib.pyplot as plt
import seaborn as sns
iris = sns.load_dataset("iris")

g =  sns.PairGrid(iris, hue='species', size=2)

def f(x, **kwargs):
    kwargs.pop("color")
    col = next(plt.gca()._get_lines.prop_cycler)['color']
    sns.kdeplot(x, color=col, **kwargs)

g.map_diag(f)
g.map_offdiag(plt.scatter)
g.add_legend()
plt.show()

1 个答案:

答案 0 :(得分:0)

该问题现已在seaborn的0.8.1版中修复。

您可以简单地使用

USER Request->JSF Config->SOAP Client ->SOAP Service->DAO

如文件中所述。

this answer中发布的解决方法也将在seaborn 0.8.1中按预期工作,并且没有任何yscaling问题。