I'm plotting some images using the code below:
start, end = 0, 3
fig = plt.figure(figsize=(25, 25))
n_cols = 3
n_rows = len(images_dict[start:end])
for i, d in enumerate(images_dict[start:end]):
ax1 = fig.add_subplot(n_rows, n_cols, n_cols * i + 1)
ax2 = fig.add_subplot(n_rows, n_cols, n_cols * i + 2)
ax3 = fig.add_subplot(n_rows, n_cols, n_cols * i + 3)
ax1.imshow(d['filled'])
ax1.set_title(d['name'])
ax2.imshow(d['img'])
ax3.imshow(d['overlay'])
I'm plotting 9 images, 3 per row, using the code above I get (though the 3rd row is cut off):
Now if I instead want to plot 20 rows, again just changing the end
variable to 20
I get:
I was wondering if there is a way to prevent matplotlib from decreasing the size of the plotted image when I increase the number of images that are plotted?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…