MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / savefig

Function savefig

lib/matplotlib/pyplot.py:1342–1348  ·  view source on GitHub ↗
(fname: str | os.PathLike | IO, **kwargs)

Source from the content-addressed store, hash-verified

1340
1341@_copy_docstring_and_deprecators(Figure.savefig)
1342def 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 ##

Callers

nothing calls this directly

Calls 3

gcfFunction · 0.85
savefigMethod · 0.45
draw_idleMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…