使用 plt.gcf 时调整数字

Adjust figure when using plt.gcf

我用

绘制了一张图片
 plt.gcf()

和命令

 plt.gca().add_artist

我用

编辑了坐标轴
 fig.gca(xlim=[-5,5],ylim=[-8,2])

问题是当我保存图像时,它给我:

我希望在任何一对轴中,我都能得到准确的图像,而不是拉伸图像。

ax = fig.gca()
ax.set_aspect('equal')