我在 python 中使用 matplotlib.pyplot 来绘制我的数据。问题是它生成的图像似乎是自动缩放的。我怎样才能关闭它,以便当我在 (0,0) 处绘制某些东西时,它会固定在中心?
最佳答案
你想要 autoscale
功能:
from matplotlib import pyplot as plt
# Set the limits of the plot
plt.xlim(-1, 1)
plt.ylim(-1, 1)
# Don't mess with the limits!
plt.autoscale(False)
# Plot anything you want
plt.plot([0, 1])
关于python - 如何在 matplotlib.pyplot 中关闭自动缩放,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38629830/