1
1
import datetime
2
+ import os
2
3
from collections .abc import Callable , Sequence
3
- from pathlib import Path
4
- from typing import Any , BinaryIO , ContextManager , Literal , overload , Unpack
4
+ from typing import Any , ContextManager , IO , Literal , overload , Unpack
5
5
6
6
import numpy as np
7
7
import numpy .typing as npt
8
8
from matplotlib import rcParams as rcParams
9
9
from matplotlib ._typing import ArrayLike , Color , FileLike , Line2DProperty , PathCollectionProperties , PathLike , Scalar
10
10
from matplotlib .colorizer import Colorizer
11
11
from matplotlib .contour import QuadContourSet
12
+ from matplotlib .layout_engine import LayoutEngine
13
+ from matplotlib .typing import ColorType
12
14
from typing_extensions import Self
13
15
14
16
from .artist import Artist
@@ -78,14 +80,16 @@ class _xkcd:
78
80
79
81
def figure (
80
82
num : int | str | Figure | SubFigure | None = None ,
81
- figsize : Sequence [float ] | None = None ,
83
+ figsize : ArrayLike | tuple [float , float , Literal [ "in" , "cm" , "px" ] ] | None = None ,
82
84
dpi : float | None = None ,
83
- facecolor : Color | None = None ,
84
- edgecolor : Color | None = None ,
85
+ * ,
86
+ facecolor : ColorType | None = None ,
87
+ edgecolor : ColorType | None = None ,
85
88
frameon : bool = True ,
86
- FigureClass = ...,
89
+ FigureClass : type [ Figure ] = ...,
87
90
clear : bool = False ,
88
- ** kwargs ,
91
+ layout : Literal ["constrained" , "compressed" , "tight" , "none" ] | LayoutEngine | None = None ,
92
+ ** kwargs : Any ,
89
93
) -> Figure : ...
90
94
def gcf () -> Figure : ...
91
95
def fignum_exists (num ) -> bool : ...
@@ -94,11 +98,11 @@ def get_figlabels(): ...
94
98
def get_current_fig_manager () -> FigureManagerBase : ...
95
99
def connect (s : str , func : Callable ): ...
96
100
def disconnect (cid : int ): ...
97
- def close (fig : None | int | str | Figure = ... ) -> None : ...
101
+ def close (fig : None | int | str | Figure | Literal [ "all" ] = None ) -> None : ...
98
102
def clf () -> None : ...
99
103
def draw () -> None : ...
100
104
def savefig (
101
- fname : str | Path | BinaryIO ,
105
+ fname : str | os . PathLike | IO ,
102
106
* ,
103
107
transparent : bool | None = None ,
104
108
dpi : float | Literal ["figure" ] = "figure" ,
0 commit comments