Title: MNT: Debug fig_size change after window close by timhoffm · Pull Request #29129 · matplotlib/matplotlib · GitHub
Open Graph Title: MNT: Debug fig_size change after window close by timhoffm · Pull Request #29129 · matplotlib/matplotlib
X Title: MNT: Debug fig_size change after window close by timhoffm · Pull Request #29129 · matplotlib/matplotlib
Description: This is a minimal reproducer for a failure in the pipeline #29125 (comment). The test_interactive_backend[toolmanager-MPLBACKEND=wxagg-BACKEND_DEPS=wx] fails in the pipeline at the subsequent assert result.getvalue() == result_after.getvalue() because the PNG data in result and result_after have different sizes (640x480) vs. (640x478); i.e. result_after is two pixels smaller. This stems from a changed fig size, as made explicit by the assert statement added here (precisely, fig.get_size_inches() changes from np.array([6.4, 4.8]) to np.array([6.4, 4.78])). I have not yet a clue why closing the figure window could change the figure size. Actually, showing the window changes the size, see below. Note: reading the exception is a bit complicated because it happens in a called subprocess, but you'll find this somewhere in the middle of the traceback: [...] assert tuple(fig.get_size_inches()) == tuple(size_inches), \\\nAssertionError: [6.4 4.78], [6.4 4.8]\n' Update: This is the call stack that leads to the changed figure size: File "/home/tim/git/matplotlib/lib/matplotlib/tests/test_backends_interactive.py", line 223, in _test_interactive_impl plt.show() File "/home/tim/git/matplotlib/lib/matplotlib/pyplot.py", line 612, in show return _get_backend_mod().show(*args, **kwargs) File "/home/tim/git/matplotlib/lib/matplotlib/backend_bases.py", line 3534, in show manager.show() # Emits a warning for non-interactive backend. File "/home/tim/git/matplotlib/lib/matplotlib/backends/backend_wx.py", line 1006, in show self.frame.Show() File "/home/tim/git/matplotlib/lib/matplotlib/backends/backend_wx.py", line 683, in _on_size self.figure.set_size_inches(winch, hinch, forward=False) Apparently show() creates a wx.EVT_SIZE, which is bound to _FigureCanvasWxBase._on_size(), and in there matplotlib/lib/matplotlib/backends/backend_wx.py Line 659 in 1c4a554 size = self.GetClientSize() returns the reduced height of 478.
Open Graph Description: This is a minimal reproducer for a failure in the pipeline #29125 (comment). The test_interactive_backend[toolmanager-MPLBACKEND=wxagg-BACKEND_DEPS=wx] fails in the pipeline at the subsequent asser...
X Description: This is a minimal reproducer for a failure in the pipeline #29125 (comment). The test_interactive_backend[toolmanager-MPLBACKEND=wxagg-BACKEND_DEPS=wx] fails in the pipeline at the subsequent asser...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/29129
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:6b5f2959-12c8-ad86-b49d-8a44a26c135e |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | AA20:1E68A5:20E3D2:2C11FD:6A52E74D |
| html-safe-nonce | e9930c7ea83fb27867bd720e2ec7d2fa6fb823a2facf1299d12ec54cf187c942 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQTIwOjFFNjhBNToyMEUzRDI6MkMxMUZEOjZBNTJFNzREIiwidmlzaXRvcl9pZCI6IjY5NjYzMjEzNjU0NDA5ODA4MTQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 8eddb2e13395783d268528bb117624dcbc737d768eedb99c25fb5ef611318a4d |
| hovercard-subject-tag | pull_request:2175386330 |
| 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/29129/files |
| twitter:image | https://avatars.githubusercontent.com/u/2836374?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/2836374?s=400&v=4 |
| og:image:alt | This is a minimal reproducer for a failure in the pipeline #29125 (comment). The test_interactive_backend[toolmanager-MPLBACKEND=wxagg-BACKEND_DEPS=wx] fails in the pipeline at the subsequent asser... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| 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 |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width