I have 7 images that I need to show in a single matplotlib figure. But there are remaining a lot of whitespace after adding the images. I tried following the second answer of this question: How do I change the figure size with subplots? but it did not work Here are my code and the output 'images' is the list of PIL images stored
fig=plt.figure(figsize=(40,20))
rows=4
columns = 2
for i in range(1,7,1):
subim = fig.add_subplot(rows, columns, i)
subim.imshow(images[i-1])
output:
I want the small images to extend and fit the width of the plot