forked from matplotlib/matplotlib
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgridspec.pyi
More file actions
174 lines (167 loc) · 5.37 KB
/
gridspec.pyi
File metadata and controls
174 lines (167 loc) · 5.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
from typing import Any, Literal, overload
from numpy.typing import ArrayLike
import numpy as np
from matplotlib._api import _Unset
from matplotlib.axes import Axes
from matplotlib.backend_bases import RendererBase
from matplotlib.figure import Figure
from matplotlib.transforms import Bbox
class GridSpecBase:
def __init__(
self,
nrows: int,
ncols: int,
height_ratios: ArrayLike | None = ...,
width_ratios: ArrayLike | None = ...,
) -> None: ...
@property
def nrows(self) -> int: ...
@property
def ncols(self) -> int: ...
def get_geometry(self) -> tuple[int, int]: ...
def get_subplot_params(self, figure: Figure | None = ...) -> SubplotParams: ...
def new_subplotspec(
self, loc: tuple[int, int], rowspan: int = ..., colspan: int = ...
) -> SubplotSpec: ...
def set_width_ratios(self, width_ratios: ArrayLike | None) -> None: ...
def get_width_ratios(self) -> ArrayLike: ...
def set_height_ratios(self, height_ratios: ArrayLike | None) -> None: ...
def get_height_ratios(self) -> ArrayLike: ...
def get_grid_positions(
self, fig: Figure
) -> tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray]: ...
@staticmethod
def _check_gridspec_exists(figure: Figure, nrows: int, ncols: int) -> GridSpec: ...
def __getitem__(
self, key: tuple[int | slice, int | slice] | slice | int
) -> SubplotSpec: ...
@overload
def subplots(
self,
*,
sharex: bool | Literal["all", "row", "col", "none"] = ...,
sharey: bool | Literal["all", "row", "col", "none"] = ...,
squeeze: Literal[False],
subplot_kw: dict[str, Any] | None = ...
) -> np.ndarray: ...
@overload
def subplots(
self,
*,
sharex: bool | Literal["all", "row", "col", "none"] = ...,
sharey: bool | Literal["all", "row", "col", "none"] = ...,
squeeze: Literal[True] = ...,
subplot_kw: dict[str, Any] | None = ...
) -> np.ndarray | Axes: ...
class GridSpec(GridSpecBase):
left: float | None
bottom: float | None
right: float | None
top: float | None
wspace: float | None
hspace: float | None
figure: Figure | None
def __init__(
self,
nrows: int,
ncols: int,
figure: Figure | None = ...,
left: float | None = ...,
bottom: float | None = ...,
right: float | None = ...,
top: float | None = ...,
wspace: float | None = ...,
hspace: float | None = ...,
width_ratios: ArrayLike | None = ...,
height_ratios: ArrayLike | None = ...,
) -> None: ...
def update(
self,
*,
left: float | None | _Unset = ...,
bottom: float | None | _Unset = ...,
right: float | None | _Unset = ...,
top: float | None | _Unset = ...,
wspace: float | None | _Unset = ...,
hspace: float | None | _Unset = ...,
) -> None: ...
def locally_modified_subplot_params(self) -> list[str]: ...
def tight_layout(
self,
figure: Figure,
renderer: RendererBase | None = ...,
pad: float = ...,
h_pad: float | None = ...,
w_pad: float | None = ...,
rect: tuple[float, float, float, float] | None = ...,
) -> None: ...
class GridSpecFromSubplotSpec(GridSpecBase):
figure: Figure | None
def __init__(
self,
nrows: int,
ncols: int,
subplot_spec: SubplotSpec,
wspace: float | None = ...,
hspace: float | None = ...,
height_ratios: ArrayLike | None = ...,
width_ratios: ArrayLike | None = ...,
) -> None: ...
def get_topmost_subplotspec(self) -> SubplotSpec: ...
class SubplotSpec:
num1: int
def __init__(
self, gridspec: GridSpecBase, num1: int, num2: int | None = ...
) -> None: ...
@staticmethod
def _from_subplot_args(figure, args): ...
@property
def num2(self) -> int: ...
@num2.setter
def num2(self, value: int) -> None: ...
def get_gridspec(self) -> GridSpecBase: ...
def get_geometry(self) -> tuple[int, int, int, int]: ...
@property
def rowspan(self) -> range: ...
@property
def colspan(self) -> range: ...
def is_first_row(self) -> bool: ...
def is_last_row(self) -> bool: ...
def is_first_col(self) -> bool: ...
def is_last_col(self) -> bool: ...
def get_position(self, figure: Figure) -> Bbox: ...
def get_topmost_subplotspec(self) -> SubplotSpec: ...
def __eq__(self, other: object) -> bool: ...
def __hash__(self) -> int: ...
def subgridspec(
self, nrows: int, ncols: int, **kwargs
) -> GridSpecFromSubplotSpec: ...
class SubplotParams:
def __init__(
self,
left: float | None = ...,
bottom: float | None = ...,
right: float | None = ...,
top: float | None = ...,
wspace: float | None = ...,
hspace: float | None = ...,
) -> None: ...
left: float
right: float
bottom: float
top: float
wspace: float
hspace: float
def update(
self,
left: float | None = ...,
bottom: float | None = ...,
right: float | None = ...,
top: float | None = ...,
wspace: float | None = ...,
hspace: float | None = ...,
) -> None: ...
def to_dict(
self,
) -> dict[str, float]: ...
def reset(self) -> None: ...