Python 中是否有 gridExtra/cowplot 类型的包与 Plotnine 一起使用以对齐子图(即边际分布)

is there gridExtra/cowplot type package in Python to use with Plotnine to align subplots (i.e. marginal distributions)

这与以下关于在 R 中的 ggplot2 中对齐子图的帖子相关:

Scatterplot with marginal histograms in ggplot2

How to plot Scatters with marginal density plots use Python?

Whosebug 上有更多关于此主题的 link。

无论如何,我无法在 Python.

中找到有关如何使用 Plotnine(ggplot2 实现)执行此操作的任何文档

在 Python 中完全可以做到这一点吗?如果没有,是否没有解决此问题的需求?

感谢您的指导。

更新:

我发现这个 link MEP 用于 matplotlib 几何管理器 #1109 这似乎表明 matplotlib 中现在存在执行此操作的功能。问题是 plotnine 是否已经扩展到这样做?

所以我对 plotnine 的了解还不够多,无法说明它是否可以做到这一点,但在 seaborn 中非常简单:https://seaborn.pydata.org/generated/seaborn.jointplot.html

>>> import numpy as np, pandas as pd; np.random.seed(0)
>>> import seaborn as sns; sns.set(style="white", color_codes=True)
>>> tips = sns.load_dataset("tips")
>>> g = sns.jointplot(x="total_bill", y="tip", data=tips)