I have an array with the shape (1, 64, 224, 224). 64 Single channel images of size 224*224. When I do this:
plt.imshow(output_image[0,1,:,:], interpolation='nearest')
The image is displayed properly.
But when I do:
for i in range(64):
plt.imshow(output_image[0,i,:,:], interpolation='nearest')
I see only 1 image as result even though there are 64 images.
How can I get a line of 64 images? What am I doing wrong?
You can create a new subplot for each image:
fig = plt.figure(figsize=(50, 50)) # width, height in inches
for i in range(64):
sub = fig.add_subplot(64, 1, i + 1)
sub.imshow(output_image[0,i,:,:], interpolation='nearest')
This will put all 64 images in one column. Change to:
sub = fig.add_subplot(8, 8, i + 1)
for eight columns and eight rows.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With