Dynamic number of subplots - position of suptitle is moving

Dear all,

I plot with gridspec a grid of subplots. If the column number is even, the overall suptitle sits in the center of the figure. If the column size is odd, it is not anymore in the center. It shifts to the right.
I tried to adjust with:

mid = (fig.subplotpars.right + fig.subplotpars.left)/2
fig.suptitle('Maps', x=mid)  

but it is hopeless.
The width of the figures is the same in inches for all plots, the height varies.

How can I fix this, please?
I have also the impression, that depending on the overall number of subplots in my grid, the fontsizes changes.

Thank you for your help.

Very hard to tell without some idea of what you are doing. However note that suptitle Centers on the figure center, not the axes spines center.

1 Like