3
找遍了許多網站,使用情節,次要情節,有些基本的動畫,和其他迂迴方式,但這一數字將不會關閉,儘管使用的close(),CLF()等如何在Python/pylab中關閉圖形或替換圖形而不必手動關閉每個圖形?
我有這樣的事情:
import numpy
from pylab import *
import time
fig = Figure()
counter1 = 0
counter2 = 0
while counter1<5:
counter1 = counter1+1
while counter2<10:
scatter(x_list[counter2], y_list[counter2], hold = 'on') ### x_list and y_list are just lists of random numbers
counter2 = counter2 + 1
show()
sleep(0.5)
close()
我正在尋找任何解決方案,如上所述。情節,subplots,動畫...
我做錯了什麼,我只是試圖運行你的例子,逐字。什麼都沒發生。使用python 2.6.6 –
發現它,你需要調用'pylab.ion()'互動。我會解決答案 –