MCPcopy Create free account
hub / github.com/ipython/ipython / set_matplotlib_close

Function set_matplotlib_close

IPython/core/display.py:1504–1527  ·  view source on GitHub ↗

Set whether the inline backend closes all figures automatically or not. By default, the inline backend used in the IPython Notebook will close all matplotlib figures automatically after each cell is run. This means that plots in different cells won't interfere. Sometimes, you may want t

(close=True)

Source from the content-addressed store, hash-verified

1502
1503@skip_doctest
1504def set_matplotlib_close(close=True):
1505 """Set whether the inline backend closes all figures automatically or not.
1506
1507 By default, the inline backend used in the IPython Notebook will close all
1508 matplotlib figures automatically after each cell is run. This means that
1509 plots in different cells won't interfere. Sometimes, you may want to make
1510 a plot in one cell and then refine it in later cells. This can be accomplished
1511 by::
1512
1513 In [1]: set_matplotlib_close(False)
1514
1515 To set this in your config files use the following::
1516
1517 c.InlineBackend.close_figures = False
1518
1519 Parameters
1520 ----------
1521 close : bool
1522 Should all matplotlib figures be automatically closed after each cell is
1523 run?
1524 """
1525 from ipykernel.pylab.config import InlineBackend
1526 cfg = InlineBackend.instance()
1527 cfg.close_figures = close

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected