Untitled

mail@pastecode.io avatar
unknown
python
2 years ago
442 B
2
Indexable
Never
def display_img_one_fig(images):
    n = len(images)
    f = plt.figure()
    for i in range(n):
        f.add_subplot(1, n, i + 1)
        plt.imshow(images[i], cmap="gray")

    plt.show(block=True)


def display_im(im1, im2=None, num_of_pic=1):
    plt.figure()
    plt.imshow(im1, cmap='gray')
    plt.figure()
    if num_of_pic != 2:
        plt.show()
        return
    plt.imshow(im2, cmap='gray')
    plt.show()