Skip to content
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 workaround for Cartopy 0.19 #4127

Closed
wants to merge 3 commits into from

Conversation

rcomer
Copy link
Member

@rcomer rcomer commented May 10, 2021

🚀 Pull Request

Description

A change at Cartopy 0.19 causes axes extent to be updated when contours are added (see SciTools/cartopy#1780). This is a problem for our special handling for antialiasing in iris.plot.contourf because maps are cropped around the extra contours (see discussion at #4125). @greglucas has written a fix at SciTools/cartopy#1784 but advised that it is unlikely to make it into a release soon. So if we want Iris v3.0.2 to play nicely with Cartopy 0.19, we will probably need a workaround. I propose this one, which just reinstates whatever the axes extent was before the call to contour.


Consult Iris pull request check list

@greglucas
Copy link

Another idea (untested) would be to call
ax.dataLim.update_from_data_xy(extent, ignore=False)
before the contour and then call it with True and the current extents right after the contour call reset it (just swap what None is defaulting too within Cartopy). I think this would get you the expanding part too in case you want that.

@rcomer
Copy link
Member Author

rcomer commented May 10, 2021

Thanks @greglucas. My version has definitely broken at least one example, so I will give your suggestion a try!

@rcomer
Copy link
Member Author

rcomer commented May 10, 2021

It may have been more sensible to target master. Now doing that over at #4128.

@rcomer
Copy link
Member Author

rcomer commented May 11, 2021

This is now in master via #4128 and #4125.

@rcomer rcomer closed this May 11, 2021
@rcomer rcomer deleted the contourf-workaround branch May 11, 2021 14:49
@rcomer
Copy link
Member Author

rcomer commented May 14, 2021

Now also in v.3.0.x branch via #4130 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants