Skip to content

Commit 694efcf

Browse files
authored
Merge pull request #2441 from rcomer/spines-callback
FIX: `_trigger_patch_reclip` takes axes instance
2 parents 763abec + 2b09850 commit 694efcf

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

lib/cartopy/mpl/geoaxes.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2302,13 +2302,12 @@ def add_wms(self, wms, layers, wms_kwargs=None, **kwargs):
23022302
GeoAxesSubplot.__module__ = GeoAxes.__module__
23032303

23042304

2305-
def _trigger_patch_reclip(event):
2305+
def _trigger_patch_reclip(axes):
23062306
"""
23072307
Define an event callback for a GeoAxes which forces the background patch to
23082308
be re-clipped next time it is drawn.
23092309
23102310
"""
2311-
axes = event.axes
23122311
# trigger the outline and background patches to be re-clipped
23132312
axes.spines['geo'].stale = True
23142313
axes.patch.stale = True

lib/cartopy/tests/mpl/test_mpl_integration.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,3 +1071,9 @@ def test_annotate():
10711071
)
10721072

10731073
return fig
1074+
1075+
1076+
def test_inset_axes():
1077+
fig, ax = plt.subplots()
1078+
ax.inset_axes([0.75, 0.75, 0.25, 0.25], projection=ccrs.PlateCarree())
1079+
fig.draw_without_rendering()

0 commit comments

Comments
 (0)