|
50 | 50 | import sys |
51 | 51 | import threading |
52 | 52 | import time |
53 | | -from typing import TYPE_CHECKING, cast, overload |
| 53 | +from typing import IO, TYPE_CHECKING, cast, overload |
54 | 54 |
|
55 | 55 | from cycler import cycler # noqa: F401 |
56 | 56 | import matplotlib |
@@ -338,8 +338,8 @@ def uninstall_repl_displayhook() -> None: |
338 | 338 |
|
339 | 339 | # Ensure this appears in the pyplot docs. |
340 | 340 | @_copy_docstring_and_deprecators(matplotlib.set_loglevel) |
341 | | -def set_loglevel(*args, **kwargs) -> None: |
342 | | - return matplotlib.set_loglevel(*args, **kwargs) |
| 341 | +def set_loglevel(level: str) -> None: |
| 342 | + return matplotlib.set_loglevel(level) |
343 | 343 |
|
344 | 344 |
|
345 | 345 | @_copy_docstring_and_deprecators(Artist.findobj) |
@@ -1259,11 +1259,11 @@ def draw() -> None: |
1259 | 1259 |
|
1260 | 1260 |
|
1261 | 1261 | @_copy_docstring_and_deprecators(Figure.savefig) |
1262 | | -def savefig(*args, **kwargs) -> None: |
| 1262 | +def savefig(fname: str | os.PathLike | IO, **kwargs) -> None: |
1263 | 1263 | fig = gcf() |
1264 | 1264 | # savefig default implementation has no return, so mypy is unhappy |
1265 | 1265 | # 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] |
1267 | 1267 | fig.canvas.draw_idle() # Need this if 'transparent=True', to reset colors. |
1268 | 1268 | return res |
1269 | 1269 |
|
|
0 commit comments