Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
MNT: Debug fig_size change after window close#29129
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
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This is a result of#28838, which enabled the test everywhere, but at the time did not seem to be causing trouble. However, I am seeing the problem with wxand Qt when building 3.10.0rc1 for Fedora. I though it was because I was running Xvfb at 680x480 and the figure didn't fit, but even at 800x600 it failed. |
timhoffm commentedNov 13, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I've tried to move the Anyway, the proper fix is to understand why I've also tried to produce a minimal example:
But (in the same environment as for the tests) this does not change figsize, so the effect seems somehow related to the addmittedly complex test setup. |
Works around the failurematplotlib#29129. A proper analysisand resolution is still needed.
Uh oh!
There was an error while loading.Please reload this page.
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 subsequentassert result.getvalue() == result_after.getvalue()
because the PNG data inresult
andresult_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 fromnp.array([6.4, 4.8])
tonp.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:
Update: This is the call stack that leads to the changed figure size:
Apparently
show()
creates awx.EVT_SIZE
, which is bound to_FigureCanvasWxBase._on_size()
, and in therematplotlib/lib/matplotlib/backends/backend_wx.py
Line 659 in1c4a554
returns the reduced height of 478.