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

Method show

lib/matplotlib/backend_bases.py:3676–3702  ·  view source on GitHub ↗

Show all figures. `show` blocks by calling `mainloop` if *block* is ``True``, or if it is ``None`` and we are not in `interactive` mode and if IPython's ``%matplotlib`` integration has not been activated.

(cls, *, block=None)

Source from the content-addressed store, hash-verified

3674
3675 @classmethod
3676 def show(cls, *, block=None):
3677 """
3678 Show all figures.
3679
3680 `show` blocks by calling `mainloop` if *block* is ``True``, or if it is
3681 ``None`` and we are not in `interactive` mode and if IPython's
3682 ``%matplotlib`` integration has not been activated.
3683 """
3684 managers = Gcf.get_all_fig_managers()
3685 if not managers:
3686 return
3687 for manager in managers:
3688 try:
3689 manager.show() # Emits a warning for non-interactive backend.
3690 except NonGuiException as exc:
3691 _api.warn_external(str(exc))
3692 if cls.mainloop is None:
3693 return
3694 if block is None:
3695 # Hack: Is IPython's %matplotlib integration activated? If so,
3696 # IPython's activate_matplotlib (>= 0.10) tacks a _needmain
3697 # attribute onto pyplot.show (always set to False).
3698 pyplot_show = getattr(sys.modules.get("matplotlib.pyplot"), "show", None)
3699 ipython_pylab = hasattr(pyplot_show, "_needmain")
3700 block = not ipython_pylab and not is_interactive()
3701 if block:
3702 cls.mainloop()
3703
3704 # This method is the one actually exporting the required methods.
3705

Callers 3

pyplot_showMethod · 0.45
configure_subplotsMethod · 0.45
__call__Method · 0.45

Calls 4

is_interactiveFunction · 0.90
get_all_fig_managersMethod · 0.80
mainloopMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected