File tree 2 files changed +10
-13
lines changed
2 files changed +10
-13
lines changed Original file line number Diff line number Diff line change @@ -864,9 +864,11 @@ def set_frameon(self, b):
864
864
self .frameon = b
865
865
self .stale = True
866
866
867
- def delaxes (self , a ):
868
- 'remove a from the figure and update the current axes'
869
- self ._axstack .remove (a )
867
+ def delaxes (self , ax ):
868
+ """
869
+ Remove the `~.Axes` *ax* from the figure and update the current axes.
870
+ """
871
+ self ._axstack .remove (ax )
870
872
for func in self ._axobservers :
871
873
func (self )
872
874
self .stale = True
Original file line number Diff line number Diff line change @@ -919,19 +919,14 @@ def axes(*args, **kwargs):
919
919
return a
920
920
921
921
922
- def delaxes (* args ):
922
+ def delaxes (ax = None ):
923
923
"""
924
- Remove an axes from the current figure. If *ax*
925
- doesn't exist, an error will be raised.
926
-
927
- ``delaxes()``: delete the current axes
924
+ Remove the given `Axes` *ax* from the current figure. If *ax* is *None*,
925
+ the current axes is removed. A KeyError is raised if the axes doesn't exist.
928
926
"""
929
- if not len ( args ) :
927
+ if ax is None :
930
928
ax = gca ()
931
- else :
932
- ax = args [0 ]
933
- ret = gcf ().delaxes (ax )
934
- return ret
929
+ gcf ().delaxes (ax )
935
930
936
931
937
932
def sca (ax ):
You can’t perform that action at this time.
0 commit comments