Skip to content

[ENH]: add width/height_ratios to subplots and friends #21942

@jklymak

Description

@jklymak

Currently we must do fig, ax = plt.subplots(1, 2, gridspec_kw={'width_ratios': [2, 1]}). This is pretty clunky, and we now try to shelter the user from the gridspec concept as much as possible. I don't see any reason we should not offer: fig, ax = plt.subplots(1, 2, width_ratios=[2, 1]). See also plt.subplots_mosaic.

I'm not sure about the wspace and hspace parameters. They are somewhat fragile as they get changed by layout managers, but they could also be exposed.

In the case of a clash between width_ratios and gridspec_kw={'width_ratios', []} probably the lower-level call should win.

Marking as Good First Issue, as hoisting this is quite easy, but any new contributors should probably watch this space for an OK as to whether this is generally acceptable.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy