0

I have three lits of images stored in x,y,z. Now I want to plot 4 images from each list in vertical format. When I coded it only shows two list

plt.figure(figsize=(50, 15))
for i in range(4):
    ax = plt.subplot(3,4,i+1)
    plt.imshow(x[i])
    ax = plt.subplot(3, 4, i + 1)
    plt.imshow(y[i])
    ax = plt.subplot(3, 4, i+5)
    plt.imshow(z[i])
plt.show()

Output:- output can be found by clicking here

It displays only the list y and z images but not the images of list x. How do I display three lists of images vertically using matplotlib in python?

gm tom
  • 101
  • 6
  • 1
    Should be i + 5 and i + 9. Perhaps less confusing is fig, axs=plt.subplots(3,4) and then axs[0,0].imshow down to axs[2, 3] – Jody Klymak Aug 17 '21 at 14:10

0 Answers0