[問題] 請問 Matplotlib clf() ?

看板Python作者 (熱~)時間6年前 (2017/11/23 18:27), 編輯推噓0(002)
留言2則, 1人參與, 6年前最新討論串1/2 (看更多)
想請問各位, 當我使用 plt.figure() plt.imshow(image) plt.show() plt.clf() 我可以成功的打開圖檔 (Figure 1),然後他也會再把 Figure 1 清空, 但如果我用 plt.figure(1) plt.imshow(image) plt.show() plt.clf() 就是說我開 figure 的時候是有指定號碼, 這時候就沒有辦法成功的清除 figure 中的圖檔。 我想請問的是有甚麼方法可以清除指定的 figure 中的圖嗎? 謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 60.248.185.82 ※ 文章網址: https://www.ptt.cc/bbs/Python/M.1511432861.A.FD2.html

11/23 19:08, 6年前 , 1F
我試起來正常的說,http://pasted.co/050b042f
11/23 19:08, 1F

11/23 19:10, 6年前 , 2F
Python 3.6.1,matplotlib (2.0.0)
11/23 19:10, 2F
文章代碼(AID): #1Q5gAT_I (Python)
文章代碼(AID): #1Q5gAT_I (Python)