Skip to content

Commit 378172b

Browse files
authored
Merge pull request matplotlib#25444 from anntzer/facl
Adjust parent axes limits when clearing floating axes.
2 parents 9700f74 + 6a4e1f1 commit 378172b

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

lib/mpl_toolkits/axisartist/floating_axes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,6 @@ def __init__(self, *args, grid_helper, **kwargs):
260260
_api.check_isinstance(GridHelperCurveLinear, grid_helper=grid_helper)
261261
super().__init__(*args, grid_helper=grid_helper, **kwargs)
262262
self.set_aspect(1.)
263-
self.adjust_axes_lim()
264263

265264
def _gen_axes_patch(self):
266265
# docstring inherited
@@ -281,6 +280,7 @@ def clear(self):
281280
orig_patch.set_transform(self.transAxes)
282281
self.patch.set_clip_path(orig_patch)
283282
self.gridlines.set_clip_path(orig_patch)
283+
self.adjust_axes_lim()
284284

285285
def adjust_axes_lim(self):
286286
bbox = self.patch.get_path().get_extents(

lib/mpl_toolkits/axisartist/tests/test_floating_axes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ def test_curvelinear4():
8282
tick_formatter1=angle_helper.FormatterDMS(),
8383
tick_formatter2=None)
8484
ax1 = fig.add_subplot(axes_class=FloatingAxes, grid_helper=grid_helper)
85+
ax1.clear() # Check that clear() also restores the correct limits on ax1.
8586

8687
ax1.axis["left"].label.set_text("Test 1")
8788
ax1.axis["right"].label.set_text("Test 2")

0 commit comments

Comments
 (0)