繁体   English   中英

使用Matplotlib和iPython,如何将x和y轴限制重置为自动缩放?

[英]Using Matplotlib and iPython, How to reset x and y axis limits to Autoscale?

使用matplotlib和iPython,我有一堆我想要查看的图(一个接一个)。 某些图仅包含0到1的值,有些包含数百万的值。

使用以下方法设置y轴限制后:

ylim((.7,1))

我希望能够重置此设置以自动设置限制(就像之前所做的那样)。 我找不到正确的方法。

ax = plt.gca()  # get the current axes
ax.relim()      # make sure all the data fits
ax.autoscale()  # auto-scale
# only needed mpl < 1.5
# ax.figure.canvas.draw_idle()       # re-draw the figure

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM