Skip to content

DOC: correctly specify return type of figaspect #29545

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/matplotlib/figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -3655,8 +3655,8 @@ def figaspect(arg):

Returns
-------
width, height : float
The figure size in inches.
size : (2,) array
The width and height of the figure in inches.

Notes
-----
Expand Down
4 changes: 3 additions & 1 deletion lib/matplotlib/figure.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -418,4 +418,6 @@ class Figure(FigureBase):
rect: tuple[float, float, float, float] | None = ...
) -> None: ...

def figaspect(arg: float | ArrayLike) -> tuple[float, float]: ...
def figaspect(
arg: float | ArrayLike,
) -> np.ndarray[tuple[Literal[2]], np.dtype[np.float64]]: ...
2 changes: 1 addition & 1 deletion lib/matplotlib/pyplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ def figure(
# autoincrement if None, else integer from 1-N
num: int | str | Figure | SubFigure | None = None,
# defaults to rc figure.figsize
figsize: tuple[float, float] | None = None,
figsize: ArrayLike | None = None,
# defaults to rc figure.dpi
dpi: float | None = None,
*,
Expand Down