Plotting images side by side using matplotlib

后端 未结 5 1109
难免孤独
难免孤独 2020-12-23 09:36

I was wondering how I am able to plot images side by side using matplotlib for example something like this:

The closest I got is this:

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-23 09:56

    One thing that I found quite helpful to use to print all images :

    _, axs = plt.subplots(n_row, n_col, figsize=(12, 12))
    axs = axs.flatten()
    for img, ax in zip(imgs, axs):
        ax.imshow(img)
    plt.show()
    

提交回复
热议问题