[英]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.