10000 URL is not shown when webagg failed to open the browser. · Issue #15650 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
URL is not shown when webagg failed to open the browser. #15650
Closed
@GreenCourt

Description

@GreenCourt

Thanks for developping!
Currently, the URL is shown only when rcParams['webagg.open_in_browser'] is False.

# from matplotlib/lib/matplotlib/backends/backend_webagg.py
@staticmethod
    def show():
        WebAggApplication.initialize()

        url = "http://{address}:{port}{prefix}".format(
            address=WebAggApplication.address,
            port=WebAggApplication.port,
            prefix=WebAggApplication.url_prefix)

        if rcParams['webagg.open_in_browser']:
            import webbrowser
            webbrowser.open(url)
        else:
            print("To view figure, visit {0}".format(url))

        WebAggApplication.start()
  • Is it possible to print the URL when webbrowser.open failed?
  • Or, simply set webagg.open_in_browser to False when $DISPLAY is empty on Linux?

Matplotlib version

  • Operating system: Debian 10
  • Matplotlib version: 3.1.1
  • Matplotlib backend (print(matplotlib.get_backend())): webagg
  • Python version: 3.7.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    Difficulty: Easyhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issuesGood first issueOpen a pull request against these issues if there are no active ones!

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0