相关疑难解决方法(0)

如何在Subplot中绘制多个Seaborn Jointplot

我在将Seaborn Jointplot放在多列中时遇到了问题subplot.

import pandas as pd
import seaborn as sns

df = pd.DataFrame({'C1': {'a': 1,'b': 15,'c': 9,'d': 7,'e': 2,'f': 2,'g': 6,'h': 5,'k': 5,'l': 8},
          'C2': {'a': 6,'b': 18,'c': 13,'d': 8,'e': 6,'f': 6,'g': 8,'h': 9,'k': 13,'l': 15}})

fig = plt.figure();   
ax1 = fig.add_subplot(121);  
ax2 = fig.add_subplot(122);

sns.jointplot("C1", "C2", data=df, kind='reg', ax=ax1)
sns.jointplot("C1", "C2", data=df, kind='kde', ax=ax2)
Run Code Online (Sandbox Code Playgroud)

注意如何只将一部分jointplot放置在子图内,其余部分留在另外两个图框内.我想要的是distributions同时插入内部subplots.

有人能帮忙吗?

python matplotlib python-3.x pandas seaborn

34
推荐指数
4
解决办法
2万
查看次数

标签 统计

matplotlib ×1

pandas ×1

python ×1

python-3.x ×1

seaborn ×1