Skip to content

Commit b863ba2

Browse files
committed
Update savefig signature on pyplot.py
1 parent 1ff2bd2 commit b863ba2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/matplotlib/pyplot.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
import sys
5151
import threading
5252
import time
53-
from typing import TYPE_CHECKING, cast, overload
53+
from typing import IO, TYPE_CHECKING, cast, overload
5454

5555
from cycler import cycler # noqa: F401
5656
import matplotlib
@@ -1259,11 +1259,11 @@ def draw() -> None:
12591259

12601260

12611261
@_copy_docstring_and_deprecators(Figure.savefig)
1262-
def savefig(*args, **kwargs) -> None:
1262+
def savefig(fname: str | os.PathLike | IO, **kwargs) -> None:
12631263
fig = gcf()
12641264
# savefig default implementation has no return, so mypy is unhappy
12651265
# presumably this is here because subclasses can return?
1266-
res = fig.savefig(*args, **kwargs) # type: ignore[func-returns-value]
1266+
res = fig.savefig(fname, **kwargs) # type: ignore[func-returns-value]
12671267
fig.canvas.draw_idle() # Need this if 'transparent=True', to reset colors.
12681268
return res
12691269

0 commit comments

Comments
 (0)