(fname: str | os.PathLike | IO, **kwargs)
| 1340 | |
| 1341 | @_copy_docstring_and_deprecators(Figure.savefig) |
| 1342 | def savefig(fname: str | os.PathLike | IO, **kwargs) -> None: |
| 1343 | fig = gcf() |
| 1344 | # savefig default implementation has no return, so mypy is unhappy |
| 1345 | # presumably this is here because subclasses can return? |
| 1346 | res = fig.savefig(fname, **kwargs) # type: ignore[func-returns-value] |
| 1347 | fig.canvas.draw_idle() # Need this if 'transparent=True', to reset colors. |
| 1348 | return res |
| 1349 | |
| 1350 | |
| 1351 | ## Putting things in figures ## |