@@ -1021,16 +1021,6 @@ def set_frameon(self, b):
1021
1021
1022
1022
frameon = property (get_frameon , set_frameon )
1023
1023
1024
- def delaxes (self , ax ):
1025
- """
1026
- Remove the `~matplotlib.axes.Axes` *ax* from the figure and update the
1027
- current axes.
1028
- """
1029
- self ._axstack .remove (ax )
1030
- for func in self ._axobservers :
1031
- func (self )
1032
- self .stale = True
1033
-
1034
1024
def add_artist (self , artist , clip = False ):
1035
1025
"""
1036
1026
Add any :class:`~matplotlib.artist.Artist` to the figure.
@@ -1366,10 +1356,10 @@ def add_subplot(self, *args, **kwargs):
1366
1356
# add a red subplot that share the x-axis with ax1
1367
1357
fig.add_subplot(224, sharex=ax1, facecolor='red')
1368
1358
1369
- #delete x2 from the figure
1359
+ # delete x2 from the figure
1370
1360
fig.delaxes(ax2)
1371
1361
1372
- #add x2 to the figure again
1362
+ # add x2 to the figure again
1373
1363
fig.add_subplot(ax2)
1374
1364
"""
1375
1365
if not len (args ):
@@ -1424,7 +1414,7 @@ def _add_axes_internal(self, key, ax):
1424
1414
"""Private helper for `add_axes` and `add_subplot`."""
1425
1415
self ._axstack .add (key , ax )
1426
1416
self .sca (ax )
1427
- ax ._remove_method = self ._remove_ax
1417
+ ax ._remove_method = self .delaxes
1428
1418
self .stale = True
1429
1419
ax .stale_callback = _stale_figure_callback
1430
1420
return ax
@@ -1597,7 +1587,11 @@ def subplots(self, nrows=1, ncols=1, sharex=False, sharey=False,
1597
1587
# Returned axis array will be always 2-d, even if nrows=ncols=1.
1598
1588
return axarr
1599
1589
1600
- def _remove_ax (self , ax ):
1590
+ def delaxes (self , ax ):
1591
+ """
1592
+ Remove the `~.axes.Axes` *ax* from the figure; update the current axes.
1593
+ """
1594
+
1601
1595
def _reset_locators_and_formatters (axis ):
1602
1596
# Set the formatters and locators to be associated with axis
1603
1597
# (where previously they may have been associated with another
@@ -1639,7 +1633,11 @@ def _break_share_link(ax, grouper):
1639
1633
return last_ax
1640
1634
return None
1641
1635
1642
- self .delaxes (ax )
1636
+ self ._axstack .remove (ax )
1637
+ for func in self ._axobservers :
1638
+ func (self )
1639
+ self .stale = True
1640
+
1643
1641
last_ax = _break_share_link (ax , ax ._shared_y_axes )
1644
1642
if last_ax is not None :
1645
1643
_reset_locators_and_formatters (last_ax .yaxis )
0 commit comments