Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3e9ffb6

Browse files
tacaswelltimhoffm
andcommitted
DOC: tweak wording on Figure.show warning
closes #22169 Co-authored-by: Tim Hoffmann <[email protected]>
1 parent ab7917a commit 3e9ffb6

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

lib/matplotlib/figure.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2614,12 +2614,16 @@ def show(self, warn=True):
26142614
may only be shown briefly or not shown at all if you or your
26152615
environment are not managing an event loop.
26162616
2617-
Proper use cases for `.Figure.show` include running this from a
2618-
GUI application or an IPython shell.
2619-
2620-
If you're running a pure python shell or executing a non-GUI
2621-
python script, you should use `matplotlib.pyplot.show` instead,
2622-
which takes care of managing the event loop for you.
2617+
Proper use cases for `.Figure.show` include running this from a GUI
2618+
application (where there is persistently an event loop running) or
2619+
from a shell with in input hook configured (IPython will do this).
2620+
Some, but not all, GUI toolkits will register an input hook on
2621+
import. See :ref:`cp_integration` for more details.
2622+
2623+
If you're in a shell without input hook integration or executing a
2624+
python script, you should use `matplotlib.pyplot.show` with
2625+
``block=True`` instead, which takes care of starting and running
2626+
the event loop for you.
26232627
26242628
Parameters
26252629
----------

0 commit comments

Comments
 (0)