Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Always display WebAgg URL regardless of browser open status#30786

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
gowtham1412-p wants to merge1 commit intomatplotlib:main
base:main
Choose a base branch
Loading
fromgowtham1412-p:fix-webagg-url-display

Conversation

@gowtham1412-p
Copy link

Summary

Ensures the WebAgg server URL is always displayed to users, even when the browser successfully opens automatically.

Problem

Currently, the URL is only shown when:

  • webagg.open_in_browser isFalse, OR
  • The browser fails to open

This means users never see the URL when the browser opens successfully, making it difficult to:

  • Share the URL with others
  • Open in a different browser
  • Reconnect if the tab is accidentally closed

Solution

Moved theprint(f"To view figure, visit {url}") statement outside the conditional block, ensuring it always executes regardless of the browser open attempt.

Changes

  • File:lib/matplotlib/backends/backend_webagg.py
  • Method:FigureManagerWebAgg.pyplot_show()
  • Simplified conditional logic
  • URL now prints in all cases

Benefits

  • ✅ Users always know the exact URL to access their figures
  • ✅ Easier to reconnect if browser tab closes
  • ✅ Better user experience for remote/headless environments
  • ✅ Consistent behavior regardless of settings

Testing

Tested with:

  • webagg.open_in_browser = True → URL displays, browser opens
  • webagg.open_in_browser = False → URL displays, browser doesn't open
  • Simulated browser open failure → URL still displays

Fixes#15650

@rcomer
Copy link
Member

I am not familiar with webagg, but if a url successfully opens in a browser, can the user not see the url in the browser?

@rcomerrcomer added the status: needs clarificationIssues that need more information to resolve. labelNov 25, 2025
Copy link
Contributor

@ianhiianhi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I'm in general in favor of more aggressive printing out of the url for all the reasons that you note. However, I don't think this is the right approach as leaves anyone using webagg as part of an application with a print statement that they cannot suppress, something that that they may not want.

Ideally there would be an escape hatch for that case.

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

Reviewers

1 more reviewer

@ianhiianhiianhi requested changes

Reviewers whose approvals may not affect merge requirements

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

GUI: webaggstatus: needs clarificationIssues that need more information to resolve.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

URL is not shown when webagg failed to open the browser.

3 participants

@gowtham1412-p@rcomer@ianhi

[8]ページ先頭

©2009-2025 Movatter.jp