I am trying to show images one after another in a loop in one figure, meaning that after image 1 is shown, after a few second, image 2 be shown in the same figure. I have the following code so far:
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
%matplotlib inline
for i in range(1,4):
PATH = "kodim01.png"
N = "%02d" % i
print PATH.replace("01", N)
image = mpimg.imread(PATH) # images are color images
plt.show()
plt.imshow(image)
However it shows one image (the first image) 3 times. although the path changes. the image does not change. Please see results below: Here
How can I 1) show all the images in one figure one after each other, i.e. the successive image be replaced to the previous one e.g. 1 sec delay between each image. and 2) show all the images, not only repeating one image?
Thanks