Skip to content

Commit c70cd78

Browse files
authored
Merge pull request matplotlib#29545 from DerWeh/doc-figaspect
DOC: correctly specify return type of `figaspect`
2 parents a364dc5 + 59b6d9c commit c70cd78

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

lib/matplotlib/figure.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3654,8 +3654,8 @@ def figaspect(arg):
36543654
36553655
Returns
36563656
-------
3657-
width, height : float
3658-
The figure size in inches.
3657+
size : (2,) array
3658+
The width and height of the figure in inches.
36593659
36603660
Notes
36613661
-----

lib/matplotlib/figure.pyi

+3-1
Original file line numberDiff line numberDiff line change
@@ -418,4 +418,6 @@ class Figure(FigureBase):
418418
rect: tuple[float, float, float, float] | None = ...
419419
) -> None: ...
420420

421-
def figaspect(arg: float | ArrayLike) -> tuple[float, float]: ...
421+
def figaspect(
422+
arg: float | ArrayLike,
423+
) -> np.ndarray[tuple[Literal[2]], np.dtype[np.float64]]: ...

lib/matplotlib/pyplot.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,7 @@ def figure(
875875
# autoincrement if None, else integer from 1-N
876876
num: int | str | Figure | SubFigure | None = None,
877877
# defaults to rc figure.figsize
878-
figsize: tuple[float, float] | None = None,
878+
figsize: ArrayLike | None = None,
879879
# defaults to rc figure.dpi
880880
dpi: float | None = None,
881881
*,

0 commit comments

Comments
 (0)