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)
| 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 |
no test coverage detected