我正在尝试保存一张大图片(实际上比我的显示器的分辨率大),但是在增加 figsize 时我得到了相同大小的 png 图片。因此,对于下面的两个示例,我得到了完全相同的文件:
import matplotlib.pylab as plt
fig, ax = plt.subplots(nrows=2, ncols=1, figsize=(10, 100))
ax[0].plot([0, 1], [0, 1])
ax[1].plot([0, 1], [0, 1])
fig.savefig('test1.png')
plt.close()
第二:
fig, ax = plt.subplots(nrows=2, ncols=1, figsize=(10, 150))
ax[0].plot([0, 1], [0, 1])
ax[1].plot([0, 1], [0, 1])
fig.savefig('test2.png')
plt.close()
请问有没有办法制作更大的图片?
最佳答案
感谢@ImportanceOfBeingErnest,问题确实出在PyCharm 上。
(我用的是2017.2.3)
因此,如果有人遇到同样的问题 - 只需在 PyCharm 之外尝试!
关于python - matplotlib 中是否有最大 figsize?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50257509/