matplotlib中大型子地块上的标题重叠

2024-04-26 12:33:25 发布

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

重叠子地块图形

enter image description here

相关代码

plt2287 = fig.add_subplot(661)
plt2287.plot(X_wavelength, y_2287)
plt2287.title.set_text(' 2287 ')

plt2092 = fig.add_subplot(662)
plt2092.plot(X_wavelength, y_2092)
plt2092.title.set_text(' 2092 ')

plt2287 = fig.add_subplot(661)
plt2287.plot(X_wavelength, y_2287)
plt2287.title.set_text(' 2287 ')

plt2092 = fig.add_subplot(662)
plt2092.plot(X_wavelength, y_2092)
plt2092.title.set_text(' 2092 ')

plt2146 = fig.add_subplot(667)
plt2146.plot(X_wavelength, y_2146)
plt2146.title.set_text(' 2146 ')

plt2424 = fig.add_subplot(668)
plt2424.plot(X_wavelength, y_2424)
plt2424.set_title(' 2424 ')

plt.show()

我有什么特别的遗漏吗?为什么会这样?你知道吗

adjusting subplots不同,因为我不能不断地重新调整值。有超过32个子地块,这变得非常困难。还有,为什么会这样?我试过使用.set_title'title.set_text


Tags: 代码textadd图形plottitlefigset