From d4b7bc6b62d89a0b784967a115a28f347aa5aecb Mon Sep 17 00:00:00 2001 From: Marco Gorelli <33491632+MarcoGorelli@users.noreply.github.com> Date: Tue, 15 Jul 2025 13:57:26 +0100 Subject: [PATCH] Fix: correct typing overloads for ``Figure.subfigures`` --- lib/matplotlib/figure.pyi | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/figure.pyi b/lib/matplotlib/figure.pyi index 61dc79619a80..45f4eb577c51 100644 --- a/lib/matplotlib/figure.pyi +++ b/lib/matplotlib/figure.pyi @@ -191,11 +191,24 @@ class FigureBase(Artist): def align_labels(self, axs: Iterable[Axes] | None = ...) -> None: ... def add_gridspec(self, nrows: int = ..., ncols: int = ..., **kwargs) -> GridSpec: ... @overload + def subfigures( + self, + nrows: int, + ncols: int, + squeeze: Literal[False], + wspace: float | None = ..., + hspace: float | None = ..., + width_ratios: ArrayLike | None = ..., + height_ratios: ArrayLike | None = ..., + **kwargs + ) -> np.ndarray: ... + @overload def subfigures( self, nrows: int = ..., ncols: int = ..., - squeeze: Literal[False] = ..., + *, + squeeze: Literal[False], wspace: float | None = ..., hspace: float | None = ..., width_ratios: ArrayLike | None = ...,
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: