Skip to content

Commit d4b7bc6

Browse files
committed
Fix: correct typing overloads for Figure.subfigures
1 parent d2050cb commit d4b7bc6

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)