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

2024-09-29 01:27:54 发布

您现在位置:Python中文网/ 问答频道 /正文

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

Scatterplot with marginal histograms in ggplot2

How to plot Scatters with marginal density plots use Python?

Perfectly align several plots

关于这个主题,StackOverflow还有很多链接。在

无论如何,我还没有找到任何关于如何使用Python中的Plotnine(ggplot2实现)来实现这一点的文档。在

这在Python中可以实现吗?如果不是的话,对这个问题没有任何解决的需求吗?在

谢谢你的指导。在

更新:

我找到了这个链接MEP for a matplotlib geometry manager #1109 ,它似乎表明matplotlib中现在有实现此功能的功能。问题是plotnine有没有被扩展到这个位置?在


Tags: toin功能plotmatplotlib链接with帖子
1条回答
网友
1楼 · 发布于 2024-09-29 01:27:54

我不知道这是不是很容易

>>> 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)

相关问题 更多 >