For an interactive interface where the user can add more plots, it seems impossible to use constrained_layout.
The whole adding a new axes is unnecesarily complex but it can be done. A new gridspec is set-up and the current axes are repositioned into their new "slots". This is working.
However the constrained_layout solver fails (error that height or width is 0).
Proposed Solution
It seems that some work has already been performed as part of setting a colorbar. It seems to me that with some effort it would be possible to extend that solution to be more generic.
Otherwise the whole layout boxes set-up could be exposed to the external API, such that the users can use it in a similar fashion.
(Ideally the matploplib API could make simpler adapating the gridspec after it has been created)
Additional context and prior art
None
For an interactive interface where the user can add more plots, it seems impossible to use constrained_layout.
The whole adding a new axes is unnecesarily complex but it can be done. A new gridspec is set-up and the current axes are repositioned into their new "slots". This is working.
However the constrained_layout solver fails (error that height or width is 0).
Proposed Solution
It seems that some work has already been performed as part of setting a colorbar. It seems to me that with some effort it would be possible to extend that solution to be more generic.
Otherwise the whole layout boxes set-up could be exposed to the external API, such that the users can use it in a similar fashion.
(Ideally the matploplib API could make simpler adapating the gridspec after it has been created)
Additional context and prior art
None