Skip to content

Commit 3f22d0d

Browse files
committed
Disable set_extent bugfix in cartopy v0.18
1 parent c3f2b08 commit 3f22d0d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

proplot/wrappers.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from .config import rc
2727
from .utils import edges, edges2d, units, to_xyz, to_rgb
2828
from .internals import ic # noqa: F401
29-
from .internals import docstring, warnings, _not_none
29+
from .internals import docstring, warnings, _version, _version_cartopy, _not_none
3030
try:
3131
from cartopy.crs import PlateCarree
3232
except ModuleNotFoundError:
@@ -209,13 +209,13 @@ def default_crs(self, func, *args, crs=None, **kwargs):
209209
args, crs = args[:-1], args[-1]
210210
result = func(self, *args, crs=crs, **kwargs)
211211

212-
# Fix extent, so axes tight bounding box gets correct box!
213-
# From this issue:
212+
# Fix extent, so axes tight bounding box gets correct box! From this issue:
214213
# https://github.com/SciTools/cartopy/issues/1207#issuecomment-439975083
215-
if name == 'set_extent' and hasattr(self.outline_patch, 'orig_path'):
216-
clipped_path = self.outline_patch.orig_path.clip_to_bbox(self.viewLim)
217-
self.outline_patch._path = clipped_path
218-
self.background_patch._path = clipped_path
214+
if _version_cartopy < _version('0.18'):
215+
if name == 'set_extent':
216+
clipped_path = self.outline_patch.orig_path.clip_to_bbox(self.viewLim)
217+
self.outline_patch._path = clipped_path
218+
self.background_patch._path = clipped_path
219219
return result
220220

221221

0 commit comments

Comments
 (0)