Thanks to visit codestin.com
Credit goes to github.com

Skip to content

plt.subplots for already existing Figure #5139

Closed
@anntzer

Description

@anntzer

The plt.subplots function in very practical for creating a large number of axes simultaneously, but (afaict) always puts them on a new figure, which is impractical e.g. when embedding matplotlib in a GUI, where a Figure object may be created early on and then populated with some axes later.
I would thus suggest providing the same functionality to already existing Figure objects, e.g. by moving the implementation of plt.subplots to a Figure.add_subplots (or Figure.set_subplots, as it may make sense to clear the figure before) method, and have the plt.subplots function be a thin wrapper that creates the Figure and then calls its add_subplots method.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions