In ipython notebook, I am using matplotlib.pyplot imshow in a for loop like this:
for i in range(3):
plt.figure()
plt.imshow(I[i])
print("some explanation for image " + str(i))
Basically I hope to show each image followed by a print out sentence. But what I get is 3 sentences are printed out together, then followed with 3 images.
I tried to use time.sleep(1) before print() but does not work. Any idea to get the outputs of plt.imshow() and print() interleaving with each other?