Limitations of matplotlib's constrained layout are not taken into account
Please see: https://matplotlib.org/tutorials/intermediate/constrainedlayout_guide.html#limitations
Basically we should not be using plt.subplot
and should be using GridSpec
.
I think this was recently added to the documentation so we didn't know before.
Another thing that we did not know is that plt.subplots_adjust
and plt.tight_layout
should not be used when constrained_layout is True.
In matplotlib 2.2.3 now constrained_layout is automatically is set to False if either of those is used. See: https://github.com/matplotlib/matplotlib/pull/11588/files
I think we should rethink our usage to make sure we don't go out of supported bounds of matplotlib's constrained layout. Probably then, we can remove a lot of hacks that we had to do.