Skip to content

Commit bff64cc

Browse files
authored
Merge pull request #30314 from MarcoGorelli/fix-overloads
[MNT] Typing: correct typing overloads for ``Figure.subfigures``
2 parents ea350fa + d4b7bc6 commit bff64cc

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

lib/matplotlib/figure.pyi

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,24 @@ class FigureBase(Artist):
191191
def align_labels(self, axs: Iterable[Axes] | None = ...) -> None: ...
192192
def add_gridspec(self, nrows: int = ..., ncols: int = ..., **kwargs) -> GridSpec: ...
193193
@overload
194+
def subfigures(
195+
self,
196+
nrows: int,
197+
ncols: int,
198+
squeeze: Literal[False],
199+
wspace: float | None = ...,
200+
hspace: float | None = ...,
201+
width_ratios: ArrayLike | None = ...,
202+
height_ratios: ArrayLike | None = ...,
203+
**kwargs
204+
) -> np.ndarray: ...
205+
@overload
194206
def subfigures(
195207
self,
196208
nrows: int = ...,
197209
ncols: int = ...,
198-
squeeze: Literal[False] = ...,
210+
*,
211+
squeeze: Literal[False],
199212
wspace: float | None = ...,
200213
hspace: float | None = ...,
201214
width_ratios: ArrayLike | None = ...,

0 commit comments

Comments
 (0)
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