I am trying to review a list of images in Matplotlib. However, I found that plt.close()
does not close the current plot, and I need to manually do close the window. How can I resolve this?
import matplotlib.pyplot as plt
from PIL import Image
for imgpath in imgpth_list:
show_image(imgpath)
image = Image.open(imgpath)
title = imgpath.split("/")[-1]
plt.imshow(image)
plt.title(title)
plt.axis('off')
plt.show()
_ = input("Press [enter] to continue.")
plt.close()