Skip to content

Commit b4c1acd

Browse files
authored
Merge pull request matplotlib#30292 from GameRoMan/auto-backport-of-pr-30237-on-v3.10.x
Backport PR matplotlib#30237: Add explicit `**options: Any` for `add_subplot` m…
2 parents 8076615 + 4244fb2 commit b4c1acd

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

lib/matplotlib/figure.pyi

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ from matplotlib.lines import Line2D
2525
from matplotlib.patches import Rectangle, Patch
2626
from matplotlib.text import Text
2727
from matplotlib.transforms import Affine2D, Bbox, BboxBase, Transform
28+
from mpl_toolkits.mplot3d import Axes3D
29+
2830
from .typing import ColorType, HashableList
2931

3032
_T = TypeVar("_T")
@@ -87,17 +89,20 @@ class FigureBase(Artist):
8789

8890
# TODO: docstring indicates SubplotSpec a valid arg, but none of the listed signatures appear to be that
8991
@overload
92+
def add_subplot(self, *args: Any, projection: Literal["3d"], **kwargs: Any) -> Axes3D: ...
93+
@overload
9094
def add_subplot(
91-
self, nrows: int, ncols: int, index: int | tuple[int, int], **kwargs
95+
self, nrows: int, ncols: int, index: int | tuple[int, int], **kwargs: Any
9296
) -> Axes: ...
9397
@overload
94-
def add_subplot(self, pos: int, **kwargs) -> Axes: ...
98+
def add_subplot(self, pos: int, **kwargs: Any) -> Axes: ...
9599
@overload
96-
def add_subplot(self, ax: Axes, **kwargs) -> Axes: ...
100+
def add_subplot(self, ax: Axes, **kwargs: Any) -> Axes: ...
97101
@overload
98-
def add_subplot(self, ax: SubplotSpec, **kwargs) -> Axes: ...
102+
def add_subplot(self, ax: SubplotSpec, **kwargs: Any) -> Axes: ...
99103
@overload
100-
def add_subplot(self, **kwargs) -> Axes: ...
104+
def add_subplot(self, **kwargs: Any) -> Axes: ...
105+
101106
@overload
102107
def subplots(
103108
self,

0 commit comments

Comments
 (0)