8000 Adding subplots dynamically with constrained_layout · Issue #19730 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
Adding subplots dynamically with constrained_layout #19730
Closed
@juliospain

Description

@juliospain

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0