-
Notifications
You must be signed in to change notification settings - Fork 368
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FIX: plot after contour shouldn't shrink extent #2129
Conversation
The Ubuntu py3.8 tests seem to be picking up an older version of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the clear explanation, I think I'm following now!
Should we actually be using this Axes method instead? Which I think basically does what you're doing here.
https://github.com/matplotlib/matplotlib/blob/d772e0d4306eac3a1b14f9099711f6261153a1f0/lib/matplotlib/axes/_base.py#L2485-L2508
On the tests... :( We pin to that version of proj/pyproj, but it is odd that it is failing on only a couple of tests.
28aa213
to
00d6586
Compare
I looked at the py38 CI on another recent PR, and it has proj-8, but this is getting proj-7.2. |
I thought proj was only being used for geodesics at this point, but perhaps that is the issue... I'm still hopeful that we'll rely exclusively on pyproj in the future so we don't have separate pins for the two. proj8 was released in March 2021, so we could probably pin that high if need be until we get the proj dependence removed: https://github.com/OSGeo/PROJ/releases It also looks like we need to update something with the sphinx gallery logo for the docs too. Lets address those in separate PRs though. |
The failling tests and docs are unrelated and have been addressed in other PRs. |
Thanks @greglucas! |
Rationale
Fixes #2128.
We already have the
ignore=False
withinupdate_from_data_xy
so that the contour call itself doesn't shrink the extent. The equivalent line forplot
ishttps://github.com/matplotlib/matplotlib/blob/d731d48b2431da0cf8d7edaa687f997857b112af/lib/matplotlib/axes/_base.py#L2366-L2368
which relies on
ax.ignore_existing_data_limits
to decide whether to shrink. Under normal circumstances, this flag is set within update_datalim, which is called by Matplotlib'scontour
. However, for the combination of transform and invalid latitude in the linked issue, thexys
that gets passed toupdate_datalim
is all nans.Implications