I do not know why some need to write show()
, cycle time would not, seek large explained to me, in addition, how to write to cycle through multiple images when elegance
Display a simple code as follows
from matplotlib import pyplot as plt
import numpy as np
plt.imshow(np.random.randint(0, 2, (2, 2)))
plt.show()
Continuous change of a map write
from matplotlib import pyplot as plt
import numpy as np
while 1:
plt.cla()
plt.imshow(np.random.randint(0, 2, (2, 2)))
plt.pause(0.1)
Sometimes you need to compare the two figures together look, I wrote this code, but the big picture or the picture more than the feeling of Caton there, I think it is memory not removed, seeking guidance Gangster
from matplotlib import pyplot as plt
import numpy as np
while 1:
plt.cla()
ax1 = plt.subplot(1, 2, 1)
ax1.imshow(np.random.randint(0, 2, (2, 2)))
ax2 = plt.subplot(1, 2, 2)
ax2.imshow(np.random.randint(0, 2, (2, 2)))
plt.pause(0.1)
ax1.cla()
ax2.cla()