FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Backport PR #32415 on branch v3.11.x (DOC: clarify GridSpec ratio updates) by meeseeksmachine · Pull Request #32436 · matplotlib/matplotlib · GitHub

Repository navigation

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
18 changes: 18 additions & 0 deletions lib/matplotlib/gridspec.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,15 @@ def set_width_ratios(self, width_ratios):

*width_ratios* must be of length *ncols*. Each column gets a relative
width of ``width_ratios[i] / sum(width_ratios)``.

Notes
-----
If Axes have already been created from this GridSpec, this method only
updates the ratios stored by the GridSpec. Existing Axes are not
repositioned automatically. To apply the new ratios to existing
Axes, use a layout engine (for example, ``Figure(layout="constrained")``)
or re-evaluate each Axes' SubplotSpec with
``ax.set_subplotspec(ax.get_subplotspec())``.
"""
if width_ratios is None:
width_ratios = [1] * self._ncols
Expand All @@ -126,6 +135,15 @@ def set_height_ratios(self, height_ratios):

*height_ratios* must be of length *nrows*. Each row gets a relative
height of ``height_ratios[i] / sum(height_ratios)``.

Notes
-----
If Axes have already been created from this GridSpec, this method only
updates the ratios stored by the GridSpec. Existing Axes are not
repositioned automatically. To apply the new ratios to existing
Axes, use a layout engine (for example, ``Figure(layout="constrained")``)
or re-evaluate each Axes' SubplotSpec with
``ax.set_subplotspec(ax.get_subplotspec())``.
"""
if height_ratios is None:
height_ratios = [1] * self._nrows
Expand Down
Loading

Back | FazBrowse Home | New Git URL