[英]How to update a matplotlib figure from loop?
標題說。
我想用matplotlib繪制點雲的演變。 因此,我想在每個循環迭代中重繪同一窗口中的圖形而不阻塞應用程序。
編輯1:我的代碼的偽代碼段
x,y = init_points() // x,y are 2D coordinates
plt.ion()
plt.figure()
while transformation:
x, y= transform(x,y)
plt.plot(x, y)
plt.draw()
基本上我設法得出了積分。 但新的觀點被添加到舊圖中。 我想完全重繪一下這個數字。
我想我需要類似於Matlab的hold / hold off
這可能對您有所幫助:
plt.clf()
這清除了這個數字。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.