-
Notifications
You must be signed in to change notification settings - Fork 361
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
contourf issues with mpl3.8 #2224
Comments
Can you install |
This only manifests itself with Matplotlib main, so it seems to be due to Matplotlib's contour update and not any of the Cartopy changes we added. (Cartopy 0.21 + matplotlib main also shows this issue) I sort of wonder if we are getting the right path code splitting from the new compound paths? i.e. now we have one list with possibly multiple CLOSEPOLYs in the middle I think this is worth holding up the release for as it seems like there is probably something larger going on with the new contouring updates than we were expecting. |
The problem contour is at 40: if we remove that then the plot looks fine. So a better example to see what's going on might be with Good: Bad: It looks like the yellow patch is the inverse of what it should be - |
I think I found it. There is a tiny region around 82S, 160E which should be yellow in #2224 (comment). In the old cartopy/lib/cartopy/mpl/patch.py Lines 170 to 183 in 3ff2b13
I made a change there that fixes the current example. I need to tidy up and do some more testing but hopefully I will have a PR by the end of the day 🤞 |
Description
I am sorry for raising this so late in the day, but I only today thought to test my "real work" against the upcoming releases.
contourf
seems occasionally very broken.Code to reproduce
z500_djf_bias.nc.zip
With Cartopy 0.21.1 and Matplotlib 3.7.2 I get
With Cartopy main and Matplotlib main I get
I have a variety of these plots and only some are affected, so I guess it's a function of exactly where the contours end up. Hence I attach a NetCDF file rather than attempting to create an example with dummy data.
Plotting the
data
array directly with Matplotlib looks sensible, and manually wrapping my data so the longitudes match the projection also gives me a sensible plot.So I think this might be specific to Cartopy's transforms, though I've no idea whether the fix should be here or in Matplotlib.
Full environment definition
Operating system
RHEL7
Cartopy version
main
conda list
The text was updated successfully, but these errors were encountered: