0

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()
Jake
  • 2,482
  • 7
  • 27
  • 51
  • 1
    Is your problem [similar to this](https://stackoverflow.com/q/17149646/8881141)? Non-blocking behaviour of matplotlib is often fickle and depends on matplotlib version, backend, and OS. – Mr. T Oct 24 '20 at 08:58
  • 1
    oh, yes~ it works now thanks! – Jake Oct 25 '20 at 09:32

0 Answers0