8000 Adding GridSpec.subplots? · Issue #14155 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
Adding GridSpec.subplots? #14155
Closed
Closed
@anntzer

Description

@anntzer

A variant on #13280, that I'm opening as an issue for now as there was quite some pushback against #13280 so I won't bother implementing this proposal if there's the same pushback against it :)

I'm proposing to add GridSpec.subplots() (or .add_subplots(), depending on how we want to bikeshed it), such that

axs = plt.figure().add_gridspec(
    nrows, ncols, height_ratios=..., width_ratios=...).subplots()

is equivalent to

axs = plt.figure().subplots(
    nrows, ncols, gridspec_kw={"height_ratios": ..., "width_ratios": ...})

the goal being just to get rid of the somewhat awkward gridspec_kw (it's a bunch of (kw)args passed down to another function, so we should just directly call that other function instead).

Thoughts?

This would also fix #1460, I'd say (as subplot_kw could be directly passed to GridSpec.subplots`).

mpl master.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0