Skip to content

Commit 00b4df2

Browse files
QuLogicmeeseeksmachine
authored andcommitted
Backport PR matplotlib#29545: DOC: correctly specify return type of figaspect
1 parent 282ef47 commit 00b4df2

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
@@ -3665,8 +3665,8 @@ def figaspect(arg):
36653665
36663666
Returns
36673667
-------
3668-
width, height : float
3669-
The figure size in inches.
3668+
size : (2,) array
3669+
The width and height of the figure in inches.
36703670
36713671
Notes
36723672
-----

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
@@ -873,7 +873,7 @@ def figure(
873873
# autoincrement if None, else integer from 1-N
874874
num: int | str | Figure | SubFigure | None = None,
875875
# defaults to rc figure.figsize
876-
figsize: tuple[float, float] | None = None,
876+
figsize: ArrayLike | None = None,
877877
# defaults to rc figure.dpi
878878
dpi: float | None = None,
879879
*,

0 commit comments

Comments
 (0)