【发布时间】:2020-05-25 14:44:21
【问题描述】:
我想使用以下代码将海生图放入子图中。有人可以提出正确的方法吗?
plt.figure(figsize=(15,5))
plt.subplot(1,2,1)
sns.lmplot(data= df, x='Attack', y= 'Defense')
plt.subplot(1,2,2)
sns.jointplot(data= df, x='Attack', y= 'Defense', kind='scatter',color='purple')
plt.show()
【问题讨论】:
-
您需要
ax1 = plt.subplot(1,2,1)和sns.lmplot(...., ax=ax1)。与 ax2 相同。
标签: python matplotlib seaborn data-science