简体   繁体   English

使用seaborn联合图绘制统一的背景颜色

[英]Plot uniform background color with seaborn jointplot

When using seaborn.jointplot with a Kernel Density Estimation, the background of the KDE does not span the whole background of the figure, resulting in ugly white margins, as shown here:当使用seaborn.jointplot和 Kernel Density Estimation 时,KDE 的背景不会跨越图形的整个背景,导致白色边缘难看,如下所示: 在此处输入图片说明

Curiously, this only happens when I use stat_func=None .奇怪的是,这只发生在我使用stat_func=None This is my calling command:这是我的调用命令:

sns.jointplot(x=data[:,1], y=data[:,2], 
    kind="kde", space=0, color='blue', stat_func=None);

Ideally, I would like to have the blue background cover all the background so that I could also use xlim and ylim keywords.理想情况下,我希望蓝色背景覆盖所有背景,以便我也可以使用xlimylim关键字。 Alternatively, if I could crop the margins to where the KDE extends, it would suffice.或者,如果我可以将边距裁剪到 KDE 延伸的位置,那就足够了。

正如评论中提到的,通过joint_kws={'shade_lowest':False}解决了这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM