If using a GUI backend with pyplot, display the figure window. If the figure was not created using `~.pyplot.figure`, it will lack a `~.backend_bases.FigureManagerBase`, and this method will raise an AttributeError. .. warning:: This does not m
(self, warn=True)
| 2767 | return backend_webagg.ipython_inline_display(self) |
| 2768 | |
| 2769 | def show(self, warn=True): |
| 2770 | """ |
| 2771 | If using a GUI backend with pyplot, display the figure window. |
| 2772 | |
| 2773 | If the figure was not created using `~.pyplot.figure`, it will lack |
| 2774 | a `~.backend_bases.FigureManagerBase`, and this method will raise an |
| 2775 | AttributeError. |
| 2776 | |
| 2777 | .. warning:: |
| 2778 | |
| 2779 | This does not manage a GUI event loop. Consequently, the figure |
| 2780 | may only be shown briefly or not shown at all if you or your |
| 2781 | environment are not managing an event loop. |
| 2782 | |
| 2783 | Use cases for `.Figure.show` include running this from a GUI |
| 2784 | application (where there is persistently an event loop running) or |
| 2785 | from a shell, like IPython, that install an input hook to allow the |
| 2786 | interactive shell to accept input while the figure is also being |
| 2787 | shown and interactive. Some, but not all, GUI toolkits will |
| 2788 | register an input hook on import. See :ref:`cp_integration` for |
| 2789 | more details. |
| 2790 | |
| 2791 | If you're in a shell without input hook integration or executing a |
| 2792 | python script, you should use `matplotlib.pyplot.show` with |
| 2793 | ``block=True`` instead, which takes care of starting and running |
| 2794 | the event loop for you. |
| 2795 | |
| 2796 | Parameters |
| 2797 | ---------- |
| 2798 | warn : bool, default: True |
| 2799 | If ``True`` and we are not running headless (i.e. on Linux with an |
| 2800 | unset DISPLAY), issue warning when called on a non-GUI backend. |
| 2801 | |
| 2802 | """ |
| 2803 | if self.canvas.manager is None: |
| 2804 | raise AttributeError( |
| 2805 | "Figure.show works only for figures managed by pyplot, " |
| 2806 | "normally created by pyplot.figure()") |
| 2807 | try: |
| 2808 | self.canvas.manager.show() |
| 2809 | except NonGuiException as exc: |
| 2810 | if warn: |
| 2811 | _api.warn_external(str(exc)) |
| 2812 | |
| 2813 | @property |
| 2814 | def axes(self): |
no outgoing calls