使用plt.gcf时调整数字

时间:2015-03-08 03:04:51

标签: image python-2.7 matplotlib

我使用

绘制图像
 plt.gcf()

和命令

 plt.gca().add_artist

我用

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

问题在于,当我保存图像时,它会给我:

enter image description here

我希望在任何一对轴上,我都能获得精确的图像,而不是拉伸的图像。

1 个答案:

答案 0 :(得分:1)

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