Search code examples
pythonmatplotlibgoogle-colaboratoryimshow

how to keep the previous images when calling matplotlib imshow() multiple times in a single cell google colab?


I wanted to show multiple images in a single cell of google colab using maltplotlib imshow()

When it is used only once in a cell, the image will be shown.

But when multiple imshow() fcalls are made , the previous imshow()s outputs are cleared .

wkwk=test("face18.jpg")
#jst for face
face_locations = face_recognition.face_locations(image)
top, right, bottom, left =face_locations[0]
sus_face = image[top:bottom, left:right]

plt.imshow(wkwk)
plt.imshow(sus_face)

here only sus_face is shown & wkwk image is not

is there any way to see both images?


Solution

  • Simply add plt.show() after each of your plt.imshow(image)