Skip to content

Commit

Permalink
Merge pull request #1696 from greglucas/v0.18.x
Browse files Browse the repository at this point in the history
V0.18.x
  • Loading branch information
QuLogic authored Dec 29, 2020
2 parents 7337bf2 + c851bfa commit 545832e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions lib/cartopy/mpl/geoaxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,12 @@ def wrapper(self, *args, **kwargs):
transform = kwargs.get('transform', None)
if transform is None:
transform = self.projection
if (isinstance(transform, ccrs.CRS) and
# Raise an error if any of these functions try to use
# a spherical source CRS.
non_spherical_funcs = ['contour', 'contourf', 'pcolormesh', 'pcolor',
'quiver', 'barbs', 'streamplot']
if (func.__name__ in non_spherical_funcs and
isinstance(transform, ccrs.CRS) and
not isinstance(transform, ccrs.Projection)):
raise ValueError('Invalid transform: Spherical {} '
'is not supported - consider using '
Expand Down Expand Up @@ -501,11 +506,12 @@ def draw(self, renderer=None, **kwargs):
# caching the resulting image;
# buffering the result by 10%...;
if not self._done_img_factory:
for factory, args, kwargs in self.img_factories:
for factory, factory_args, factory_kwargs in self.img_factories:
img, extent, origin = factory.image_for_domain(
self._get_extent_geom(factory.crs), args[0])
self._get_extent_geom(factory.crs), factory_args[0])
self.imshow(img, extent=extent, origin=origin,
transform=factory.crs, *args[1:], **kwargs)
transform=factory.crs, *factory_args[1:],
**factory_kwargs)
self._done_img_factory = True

return matplotlib.axes.Axes.draw(self, renderer=renderer, **kwargs)
Expand Down

0 comments on commit 545832e

Please sign in to comment.