2017-04-20 31 views

回答

1

您需要使用show()爲每個情節。沒有show()方法,ipython只顯示最後一張圖片。

import matplotlib.pyplot as plt 
import numpy as np 
%matplotlib inline 
for i in range(4): 
    img = np.random.rand(10,10) 
    plt.imshow(img) 
    plt.show() 

結果

enter image description here

相關問題