@@ -15,7 +15,7 @@ from matplotlib.colors import Colormap, Normalize
15
15
from matplotlib .colorbar import Colorbar
16
16
from matplotlib .cm import ScalarMappable
17
17
from matplotlib .gridspec import GridSpec , SubplotSpec
18
- from matplotlib .image import _ImageBase
18
+ from matplotlib .image import _ImageBase , FigureImage
19
19
from matplotlib .layout_engine import (
20
20
ConstrainedLayoutEngine ,
21
21
LayoutEngine ,
@@ -69,7 +69,6 @@ class SubplotParams:
69
69
) -> None : ...
70
70
71
71
class FigureBase (Artist ):
72
- figure : FigureBase | None
73
72
artists : list [Artist ]
74
73
lines : list [Line2D ]
75
74
patches : list [Patch ]
@@ -154,15 +153,15 @@ class FigureBase(Artist):
154
153
* ,
155
154
sharex : bool | Literal ["none" , "all" , "row" , "col" ] = ...,
156
155
sharey : bool | Literal ["none" , "all" , "row" , "col" ] = ...,
157
- squeeze : Literal [ True ] = ...,
156
+ squeeze : bool = ...,
158
157
width_ratios : ArrayLike | None = ...,
159
158
height_ratios : ArrayLike | None = ...,
160
159
subplot_kw : dict [str , Any ] | None = ...,
161
160
gridspec_kw : dict [str , Any ] | None = ...
162
161
) -> np .ndarray | SubplotBase | Axes : ...
163
162
def delaxes (self , ax : Axes ) -> None : ...
164
163
def clear (self , keep_observers : bool = ...) -> None : ...
165
- def clf (self , keep_observers : bool = ...): ...
164
+ def clf (self , keep_observers : bool = ...) -> None : ...
166
165
167
166
@overload
168
167
def legend (self ) -> Legend : ...
@@ -203,7 +202,7 @@ class FigureBase(Artist):
203
202
def align_xlabels (self , axs : Iterable [Axes ] | None = ...) -> None : ...
204
203
def align_ylabels (self , axs : Iterable [Axes ] | None = ...) -> None : ...
205
204
def align_labels (self , axs : Iterable [Axes ] | None = ...) -> None : ...
206
- def add_gridspec (self , nrows : int = ..., ncols : int = ..., ** kwargs ): ...
205
+ def add_gridspec (self , nrows : int = ..., ncols : int = ..., ** kwargs ) -> GridSpec : ...
207
206
@overload
208
207
def subfigures (
209
208
self ,
@@ -234,7 +233,7 @@ class FigureBase(Artist):
234
233
def _gci (self ) -> ScalarMappable | None : ...
235
234
def _process_projection_requirements (
236
235
self , * args , axes_class = None , polar = False , projection = None , ** kwargs
237
- ): ...
236
+ ) -> tuple [ type [ Axes ], dict [ str , Any ]] : ...
238
237
def get_default_bbox_extra_artists (self ) -> list [Artist ]: ...
239
238
def get_tightbbox (
240
239
self ,
@@ -258,7 +257,7 @@ class FigureBase(Artist):
258
257
) -> dict [Any , Axes ]: ...
259
258
260
259
class SubFigure (FigureBase ):
261
- figure : FigureBase
260
+ figure : Figure
262
261
subplotpars : SubplotParams
263
262
dpi_scale_trans : Affine2D
264
263
canvas : FigureCanvasBase
@@ -295,6 +294,7 @@ class SubFigure(FigureBase):
295
294
def get_axes (self ) -> list [Axes ]: ...
296
295
297
296
class Figure (FigureBase ):
297
+ figure : Figure
298
298
bbox_inches : Bbox
299
299
dpi_scale_trans : Affine2D
300
300
bbox : Bbox
@@ -357,7 +357,7 @@ class Figure(FigureBase):
357
357
origin : Literal ["upper" , "lower" ] | None = ...,
358
358
resize : bool = ...,
359
359
** kwargs
360
- ): ...
360
+ ) -> FigureImage : ...
361
361
def set_size_inches (
362
362
self , w : float | tuple [float , float ], h : float | None = ..., forward : bool = ...
363
363
) -> None : ...
@@ -371,7 +371,7 @@ class Figure(FigureBase):
371
371
def clear (self , keep_observers : bool = ...) -> None : ...
372
372
def draw_without_rendering (self ) -> None : ...
373
373
def draw_artist (self , a : Artist ) -> None : ...
374
- def add_axobserver (self , func : Callable [[Figure ], Any ]): ...
374
+ def add_axobserver (self , func : Callable [[Figure ], Any ]) -> None : ...
375
375
def savefig (
376
376
self ,
377
377
fname : str | os .PathLike | IO ,
@@ -388,7 +388,7 @@ class Figure(FigureBase):
388
388
mouse_pop : MouseButton = ...,
389
389
mouse_stop : MouseButton = ...,
390
390
) -> list [tuple [int , int ]]: ...
391
- def waitforbuttonpress (self , timeout : float = ...): ...
391
+ def waitforbuttonpress (self , timeout : float = ...) -> None | bool : ...
392
392
def tight_layout (
393
393
self ,
394
394
* ,
0 commit comments