【发布时间】:2020-08-24 02:26:28
【问题描述】:
我在 Windows 10 上使用 Spyder 4.1.2,随 anaconda 一起安装。Python 3.7.7
每当我绘制 rows*cols-subplots 绘图时,出现在 spyder 控制台中的图形(现在专门用于显示图形的部分)也显示了不应绘制的轴部分,因为它已经出来了xlim 范围内。
import matplotlib.pyplot as plt
fig, ax = plt.subplots(1, 2)
ax[0].vlines([0.2, .8], ymin=0, ymax=1, color='r', clip_on=True)
ax[1].vlines([0.1, .9], ymin=0, ymax=1, color='b', clip_on=True)
ax[0].set_xlim([0, .7])
ax[1].set_xlim([.4, 1])
plt.savefig('fig')
保存的文件看起来很完美,所以它看起来像是 Spyder 的东西。
感谢您的帮助
【问题讨论】:
标签: python matplotlib console spyder subplot