fix mpl 3.11#851
Open
ahuang11 wants to merge 2 commits into
Open
Conversation
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Description
Fixes #850
I fixed a crash on matplotlib 3.11 where a
PlateCarreeorMercatorplot (also the default projection whenfeatures=[...]is passed) rendered blank on its own and raisedValueError: figure size must be positive finite not [ 8. nan]inside a layout. For these two projections GeoViews hides the native x/y axis and draws cartopy gridliner labels instead, and on matplotlib 3.11Axes._update_title_positioncomputes a non-finite titleyfor such a hidden-axisGeoAxes, which then propagates throughAxes.get_tightbboxinto the HoloViews layout sizing and makes the figure sizeNaN. I freeze the title auto-position withaxis._autotitlepos = Falsein the gridlabels path, gated on matplotlib >= 3.11 through a newMPL_GE_3_11_0flag ingeoviews.util, so the title keeps its finite default location and the earlier behavior is restored. Other projections, matplotlib < 3.11, and the bokeh backend were never affected.How to test:
AI Disclosure
Tool & Model:
Usage:
Checklist