Modifying the number of subplots

I would like to ask for some help on a problem I ran into while working on my final project.
I know we can set a specific number of subplots by calculating the number of axes through the multiples of the total number of subplots.
I wanted to plot 11 subplots. However, 11 is a prime number, so I’ll only be able to plot 11 rows with single plots or 1 row with 11 plots.
My question is “Is there any way I can set these subplots as 2 rows of 4 plots each and then a row with 3 subplots rather than such a linear pattern?”
Any answers would be appreciated.
Thanks.

You can try,

fig, axs = plt.subplots(ncols=n, nrows=m, figsize=(20,5))
ax = plot(data=data, ax=axs[0][0])
ax2 = plot(data=data2, ax=axs[1][0])

Where you can specify the number of rows and columns with n and m and can specify the spot for the plot with axs[row][col].

1 Like