GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||
GeezerVison is showing github.com — Skip hidden y-axis offset text when positioning titles (fix #31881) by binggao1230 · Pull Request #31885 · matplotlib/matplotlib Conversation
Contributor
PR summaryFixes #31881 — Root causeOn the inner subplot the y axis is shared, so its offset text is hidden ( if ax.yaxis.offsetText.get_text(): bb = ax.yaxis.offsetText.get_tightbbox(renderer) if bb.intersection(title.get_tightbbox(renderer), bb): top = bb.ymax Since #31285, FixA hidden offset text is not drawn, so it should not influence the title position. Only consider it when it is visible. This also fixes the (silently broken) title placement that occurs without Test
I verified the change against an installed 3.11.0 build by patching the single edited file (the change is pure-Python).
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsThe y-axis offset text of an inner subplot that shares its y axis is hidden but still carries text. _update_title_position only checked get_text(), so since matplotlib#31285 (which makes a hidden text report a null, non-finite tight bbox) the offset text pushed the title -- and the subplot position computed by tight_layout -- to inf/NaN. Drawing then raised "cannot convert float NaN to integer". Only consider the offset text for title placement when it is visible.
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
timhoffm
approved these changes
rcomer
approved these changes
Uh oh!
There was an error while loading. Please reload this page.
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
QuLogic
pushed a commit
that referenced
this pull request
oldrobotdev
added a commit
to oldrobotdev/PyPSA
that referenced
this pull request
Faceted statistics plots with a shared y-axis and scientific offset text crash at draw time on matplotlib 3.11.0 with 'ValueError: cannot convert float NaN to integer'. This is an upstream regression (matplotlib/matplotlib#31881, bisected to matplotlib/matplotlib#31285) fixed by matplotlib/matplotlib#31885 and milestoned for 3.11.1, which is not released yet. Exclude the broken version and add a regression test covering the offset-text faceting scenario.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabelsDevelopmentSuccessfully merging this pull request may close these issues. [Bug]: ValueError ("cannot convert float NaN to integer") when trying to show horizontally-stacked subplotsUh oh!
There was an error while loading. Please reload this page. Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later. | ||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |