I plot an array of images as subplots as follows:
fig, ax = plt.subplots(nrows=32,ncols=3, sharex=True, sharey=True)
...
for n in range(32*3):
ax = plt.subplot(32, 3, n) # select where to plot
plt.imshow(filt, cmap='gray') # plot image
n += 1
...
plt.show()
but the images are too small - seems like the plt.show()
holds the horizontal/vertical ratio to 1, so the overall plot is square, but should be 32/3 ratio. As a result, my images look very small and distant within columns:
I tried using
tight_layout()
as suggested here and tried plt.axes().set_aspect(32/3)
but it did not have any good effect. There are many examples that use equal number of subplots horizontally and vertically, so the subplots look normal, but in my case I have 32 rows and 3 columns which is scaled weirdly. What am I missing?