【发布时间】:2020-03-19 03:25:06
【问题描述】:
如何在子图中制作 wspace 和 hspace? 我有一个代码类型:
plt.figure(figsize=(12, 10))
fig1=plt.subplot(231)
plt.plot(x, y)
fig2=plt.subplot(232)
plt.plot(x, y)
fig3=plt.subplot(233)
plt.plot(x, y)
fig4=plt.subplot(234)
plt.plot(x, y)
fig5=plt.subplot(235)
plt.plot(x, y)
fig6=plt.subplot(236)
plt.plot(x, y)
我试图让单个人物的 wspace 更大:
plt.figure(figsize=(12, 10))
fig1=plt.subplot(231)
fig1.subplots_adjust(wspace=2)
错误:
fig1.subplots_adjust(wspace=2)
AttributeError: 'AxesSubplot' object has no attribute 'subplots_adjust'
以及如何改变所有轴的宽度?
我试过了:
import matplotlib as mpl
mpl.rcParams['lines.linewidth'] = 2
【问题讨论】:
标签: python python-3.x matplotlib subplot