Title: Use set_window_title rather than set_label to set title of webagg figure by ianthomas23 · Pull Request #29338 · matplotlib/matplotlib · GitHub
Open Graph Title: Use set_window_title rather than set_label to set title of webagg figure by ianthomas23 · Pull Request #29338 · matplotlib/matplotlib
X Title: Use set_window_title rather than set_label to set title of webagg figure by ianthomas23 · Pull Request #29338 · matplotlib/matplotlib
Description: Closes #29256. Previously when using the webagg backend if you wanted to change the title above a figure you would use figure.set_label('whatever') and if you used figure.canvas.manager.set_window_title('whatever') it would be ignored. This was inconsistent with other backends which use the latter. This PR changes the behaviour so that figure.canvas.manager.set_window_title('whatever') is used now for webagg, the same as the other backends. There is no test as there isn't currently any visual testing of the webagg backend. There is some draft work underway in #23540 for this. So here is a demonstration instead, using this code: import matplotlib as mpl mpl.use('webagg') import matplotlib.pyplot as plt fig1, ax1 = plt.subplots(figsize=(3, 2)) ax1.plot([1, 3, 2, 4]) fig1.canvas.manager.set_window_title('My line plot') fig2, ax2 = plt.subplots(figsize=(3, 2)) ax2.contourf([[1, 2], [3, 4]]) fig2.canvas.manager.set_window_title('My contour plot') fig3, ax3 = plt.subplots(figsize=(3, 2)) ax3.bar(x=[0, 1], height=[1, 2]) plt.show() the webagg output is: which is consistent with the output produced by e.g. the qtagg backend: PR checklist "closes #29256" is in the body of the PR description to link the related issue new and changed code is tested Plotting related features are demonstrated in an example New Features and API Changes are noted with a directive and release note Documentation complies with general and docstring guidelines
Open Graph Description: Closes #29256. Previously when using the webagg backend if you wanted to change the title above a figure you would use figure.set_label('whatever') and if you used figure.canvas.manager.set...
X Description: Closes #29256. Previously when using the webagg backend if you wanted to change the title above a figure you would use figure.set_label('whatever') and if you used figure.canvas.man...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/29338
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:04937b37-6c5d-aede-9aeb-a617faf96110 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | A522:1053A0:9BA536:DC3A13:6A5109EA |
| html-safe-nonce | 99874940c1ad68f3e75e440013fd35a30a3c8b83c79f316764b6035e8d43810b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNTIyOjEwNTNBMDo5QkE1MzY6REMzQTEzOjZBNTEwOUVBIiwidmlzaXRvcl9pZCI6IjI0OTIwMDAxNjA3NjAwMDcxNDYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | fb5f28a29febaca9d10c838c349e6a4455a5bddff8e3fda037f4203ed8cbdf51 |
| hovercard-subject-tag | pull_request:2240265286 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/matplotlib/matplotlib/pull/29338/files |
| twitter:image | https://avatars.githubusercontent.com/u/580326?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/580326?s=400&v=4 |
| og:image:alt | Closes #29256. Previously when using the webagg backend if you wanted to change the title above a figure you would use figure.set_label('whatever') and if you used figure.canvas.manager.set... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b076e100febaa00374cd89239f915d00dd3187f7c68b12bc2b7688181305344d |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2d129404fc45ea64edb1b98567c53e55b395536f |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width