Skip to content

Commit

Permalink
Avoid reusing the kwargs variable name in draw
Browse files Browse the repository at this point in the history
The kwargs name is now used as a top-level argument, which means we
can no longer use it to store image factory keywords before we call
Matplotlib's draw passing it kwargs.
  • Loading branch information
ajdawson authored and greglucas committed Dec 19, 2020
1 parent aecf80a commit 9f88664
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/cartopy/mpl/geoaxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,11 +501,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 9f88664

Please sign in to comment.