Skip to content

Commit

Permalink
updates for Cartopy 0.19 (#4128)
Browse files Browse the repository at this point in the history
  • Loading branch information
rcomer authored May 11, 2021
1 parent b7b00d7 commit bf4b307
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
12 changes: 12 additions & 0 deletions lib/iris/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1087,6 +1087,18 @@ def contourf(cube, *args, **kwargs):
# any boundary shift.
zorder = result.collections[0].zorder - 0.1
axes = kwargs.get("axes", None)

# Workaround for cartopy#1780. We do not want contour to shrink
# extent.
if axes is None:
_axes = plt.gca()
else:
_axes = axes

# Subsequent calls to dataLim.update_from_data_xy should not ignore
# current extent.
_axes.dataLim.ignore(False)

contour(
cube,
levels=levels,
Expand Down
5 changes: 3 additions & 2 deletions lib/iris/tests/results/imagerepo.json
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@
"iris.tests.test_mapping.TestLowLevel.test_simple.0": [
"https://scitools.github.io/test-iris-imagehash/images/v4/eae0943295154bcc844e6c314fb093ce7bc7c4b3a4307bc4916f3f316ed2b4ce.png",
"https://scitools.github.io/test-iris-imagehash/images/v4/faa0e55c855fdce7857a1ab16a85a50c3ea1e55e856658a5c11837096e8fe17a.png",
"https://scitools.github.io/test-iris-imagehash/images/v4/faa0e55c855fdce7857a1ab16a85a50c36a1e55e854658b5c13837096e8fe17a.png"
"https://scitools.github.io/test-iris-imagehash/images/v4/faa0e55c855fdce7857a1ab16a85a50c36a1e55e854658b5c13837096e8fe17a.png",
"https://scitools.github.io/test-iris-imagehash/images/v4/faa0e558855fd9e7857a1ab16a85a51d36a1e55a854e58a5c13837096e8fe17a.png"
],
"iris.tests.test_mapping.TestMappingSubRegion.test_simple.0": [
"https://scitools.github.io/test-iris-imagehash/images/v4/bd913e01d07ee07e926e87876f8196c1e0d36967393c1f181e2c3cb8b0f960d7.png",
Expand Down Expand Up @@ -1047,4 +1048,4 @@
"https://scitools.github.io/test-iris-imagehash/images/v4/82fe81987fdf77ffe0002addd4002805dd28df67d9a9d4625bfddc209841de20.png",
"https://scitools.github.io/test-iris-imagehash/images/v4/82fa80997f547799a0037a00d52f0956ddaf9f7e98a1816e09f5d8260bfffe00.png"
]
}
}

0 comments on commit bf4b307

Please sign in to comment.