Display multiple images in one IPython Notebook cell?

后端 未结 10 1458
面向向阳花
面向向阳花 2020-12-12 12:26

If I have multiple images (loaded as NumPy arrays) how can I display the in one IPython Notebook cell?

I know that I can use plt.imshow(ima) to display

10条回答
  •  天命终不由人
    2020-12-12 12:52

    If you don't mind an additional dependency here is a two liner using scikit-image:

    from skimage.util import montage
    plt.imshow(montage(np.array(images), multichannel=True))
    

    Set multichannel=True for color images and multichannel=False for grayscale images.

提交回复
热议问题