防止在 Seaborn Relplot 中共享 Y 轴?

Soo*_*har 11 python seaborn

我无法让 seaborn 的relplot函数在每行上使用不同的 y 轴进行绘图(同时每列共享 x 轴)。

我可以看到seaborn 中的FacetGrid和catplot方法都有一个 sharex/sharey 关键字参数可以解决我的问题,但是我在relplot.

如果打算通过访问relplot单独返回的子图,有什么方法可以解决这个问题吗?我想继续使用 relplot,因为它可以完美地处理图形大小,但FacetGrid在该领域存在很多问题。谢谢。

小智 23

这可以通过将带有FacetGrid关键字参数的字典传递给 来完成relplot,如下所示:

facet_kws={'sharey': False, 'sharex': True}
Run Code Online (Sandbox Code Playgroud)