【发布时间】:2020-07-01 13:34:43
【问题描述】:
我想从 seaborn 创建 2 个正则图,它们都是子图。我想调整图形的大小,但 sns.regplot 中没有 figsize、height 或 aspect 的属性。如何更改 figsize?
代码
fig = plt.figure()
ax0 = fig.add_subplot(121)
ax1 = fig.add_subplot(122)
sns.regplot(x='Reputation',y='Views',data=df_users,ax=ax0)
sns.regplot(x='Reputation',y='UpVotes',data=df_users,ax=ax1)
【问题讨论】:
-
fig, (ax0, ax1) = plt.subplots(ncols=2, figsize=(10, 10))? -
这行得通,我必须在编写此代码之前删除 ax0 和 ax1。
标签: python-3.x matplotlib plot seaborn figure