FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[Doc]: figure.show works beyond what is documented · Issue #22169 · matplotlib/matplotlib · GitHub

Repository navigation

[Doc]: figure.show works beyond what is documented #22169

Closed

Description

Documentation Link

https://matplotlib.org/devdocs/api/figure_api.html?highlight=figure%20show#matplotlib.figure.Figure.show

Problem

From the linked documentation

Proper use cases for Figure.show include running this from a GUI application or an IPython shell.

If you're running a pure python shell or executing a non-GUI python script, you should use matplotlib.pyplot.show instead, which takes care of managing the event loop for you.

I have just checked, and figure.show() works ALSO in a pure python shell (here it's 3.9, in Suse Tumbleweed).

Suggested improvement

Specify that after version 3.x (??) of the interpreter the event loop is managed also by a vanilla Python REPL.

Matplotlib Version

3.5.1

Activity

  1. changed the title [-][Doc]: [/-] [+][Doc]: figure.show works beyond what is documented[/+] on Jan 9, 2022
  2. timhoffm commented on Jan 11, 2022

    Member

    This needs a closer investigation, including python versions and backends. We can only broaden the usage of figure.show() if we are absolutely sure that it works in all scenarios.

  3. tacaswell commented on Jan 11, 2022

    Member

    Specify that after version 3.x (??) of the interpreter the event loop is managed also by a vanilla Python REPL.

    It is not the version of Python, but the GUI bindings. The ones I know off the top of my head are Qt: PyQt5 / PyQt6 register PyOs_InputHook ( https://docs.python.org/3/c-api/veryhigh.html#c.PyOS_InputHook) but pyside2/pyside6 does not. However, In the PyQt case there as also API to remove the input hook. I think tk also sets up the inputhook on import, not sure about gtk/wx/macsox off the top of my head. See https://matplotlib.org/stable/users/explain/interactive_guide.html#input-hook-integration for more details.

    I suspect the re-wording should be something like "this will put the window on the screen, but you are on your own to ensure an event loop is running for the Figure to be responsive (or ever render). Use at your own risk
    https://matplotlib.org/stable/users/explain/interactive_guide.html" ?

  4. added 2 commits that reference this issue on Dec 3, 2022
    9833684
    3e9ffb6
  5. added this to the v3.6.3 milestone on Dec 13, 2022
  6. added a commit that references this issue on Dec 19, 2022
    c221c1d
  7. MdUmar-tech commented on Dec 11, 2023

    @boffi , Hi I have some doubt, can I get your mail id

  8. QuLogic commented on Dec 12, 2023

    Member

    @MdUmar-tech I'm not sure why asking a random user for their email would be helpful. If you have Matplotlib usage questions, please post them on https://discourse.matplotlib.org.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL