0
whileループで実行され、すべての反復で新しいnumpy
配列を返すコードがあります。私は画面上のウィンドウにその配列を連続してレンダリングしたいと思います。numpy配列をループ内で連続してレンダリングします
Displaying Numpy Matrix as Video、Is there a way to detach matplotlib plots so that the computation can continue?、How to update matplotlib's imshow() window interactively?、およびreal-time plotting in while loop with matplotlibに基づいて、これは私の最高の試みである:それは(それだけで色を変更しない紫色の四角形を描画し、いくつかの理由で)動作しません
import matplotlib.pyplot as plt
import numpy as np
# plt.ion()
image = np.zeros((800, 800))
im = plt.imshow(image)
while True:
image += .01
im.set_data(image)
plt.pause(0.05)
plt.show()
。私はUbuntu 16.04でImageMagickを使用しています。ご協力いただきありがとうございます。