diff --git a/lib/cartopy/mpl/geoaxes.py b/lib/cartopy/mpl/geoaxes.py index b37b676a9..b55714a98 100644 --- a/lib/cartopy/mpl/geoaxes.py +++ b/lib/cartopy/mpl/geoaxes.py @@ -466,7 +466,7 @@ def hold_limits(self, hold=True): self.get_autoscaley_on()) yield - def _draw_preprocess(self, renderer): + def _draw_preprocess(self): """ Perform pre-processing steps shared between :func:`GeoAxes.draw` and :func:`GeoAxes.get_tightbbox`. @@ -484,7 +484,7 @@ def _draw_preprocess(self, renderer): # by `draw` or `get_tightbbox` are positioned and clipped correctly. self.patch._adjust_location() - def get_tightbbox(self, renderer, *args, **kwargs): + def get_tightbbox(self, renderer=None, *args, **kwargs): """ Extend the standard behaviour of :func:`matplotlib.axes.Axes.get_tightbbox`. @@ -493,7 +493,7 @@ def get_tightbbox(self, renderer, *args, **kwargs): calculating the tight bounding box. """ # Shared processing steps - self._draw_preprocess(renderer) + self._draw_preprocess() return super().get_tightbbox(renderer, *args, **kwargs) @@ -506,7 +506,7 @@ def draw(self, renderer=None, **kwargs): A global range is used if no limits have yet been set. """ # Shared processing steps - self._draw_preprocess(renderer) + self._draw_preprocess() # XXX This interface needs a tidy up: # image drawing on pan/zoom; diff --git a/lib/cartopy/tests/mpl/test_gridliner.py b/lib/cartopy/tests/mpl/test_gridliner.py index 0b59aa56a..18fcb4117 100644 --- a/lib/cartopy/tests/mpl/test_gridliner.py +++ b/lib/cartopy/tests/mpl/test_gridliner.py @@ -488,7 +488,7 @@ def test_gridliner_count_draws(): gl = ax.gridlines() with mock.patch.object(gl, '_draw_gridliner', return_value=None) as mocked: - ax.get_tightbbox(renderer=None) + ax.get_tightbbox() mocked.assert_called_once() with mock.patch.object(gl, '_draw_gridliner', return_value=None) as mocked: