File tree Expand file tree Collapse file tree 5 files changed +34
-8
lines changed
next_api_changes/deprecations Expand file tree Collapse file tree 5 files changed +34
-8
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ Inheritance
40
40
:template: autosummary.rst
41
41
:nosignatures:
42
42
43
+ Axis.clear
43
44
Axis.cla
44
45
Axis.get_scale
45
46
Original file line number Diff line number Diff line change
1
+ ``Axis.cla() `` and ``Spine.cla() ``
2
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3
+
4
+ ``Axis.cla() `` and ``Spine.cla() `` are deprecated in favor of the respective
5
+ ``clear() `` methods.
Original file line number Diff line number Diff line change @@ -1100,11 +1100,11 @@ def cla(self):
1100
1100
xaxis_visible = self .xaxis .get_visible ()
1101
1101
yaxis_visible = self .yaxis .get_visible ()
1102
1102
1103
- self .xaxis .cla ()
1104
- self .yaxis .cla ()
1103
+ self .xaxis .clear ()
1104
+ self .yaxis .clear ()
1105
1105
1106
1106
for name , spine in self .spines .items ():
1107
- spine .cla ()
1107
+ spine .clear ()
1108
1108
1109
1109
self .ignore_existing_data_limits = True
1110
1110
self .callbacks = cbook .CallbackRegistry ()
Original file line number Diff line number Diff line change @@ -768,8 +768,19 @@ def get_children(self):
768
768
return [self .label , self .offsetText ,
769
769
* self .get_major_ticks (), * self .get_minor_ticks ()]
770
770
771
- def cla (self ):
772
- """Clear this axis."""
771
+ def clear (self ):
772
+ """
773
+ Clear the axis.
774
+
775
+ This resets axis properties to their default values:
776
+
777
+ - the label
778
+ - the scale
779
+ - locators, formatters and ticks
780
+ - major and minor grid
781
+ - units
782
+ - registered callbacks
783
+ """
773
784
774
785
self .label .set_text ('' ) # self.set_label_text would change isDefault_
775
786
@@ -793,6 +804,11 @@ def cla(self):
793
804
self .set_units (None )
794
805
self .stale = True
795
806
807
+ @cbook .deprecated ("3.4" , alternative = "Axis.clear()" )
808
+ def cla (self ):
809
+ """Clear this axis."""
810
+ return self .clear ()
811
+
796
812
def reset_ticks (self ):
797
813
"""
798
814
Re-initialize the major and minor Tick lists.
Original file line number Diff line number Diff line change @@ -228,14 +228,18 @@ def register_axis(self, axis):
228
228
"""
229
229
self .axis = axis
230
230
if self .axis is not None :
231
- self .axis .cla ()
231
+ self .axis .clear ()
232
232
self .stale = True
233
233
234
- def cla (self ):
234
+ def clear (self ):
235
235
"""Clear the current spine."""
236
236
self ._position = None # clear position
237
237
if self .axis is not None :
238
- self .axis .cla ()
238
+ self .axis .clear ()
239
+
240
+ @cbook .deprecated ("3.4" , alternative = "Spine.clear()" )
241
+ def cla (self ):
242
+ self .clear ()
239
243
240
244
def _adjust_location (self ):
241
245
"""Automatically set spine bounds to the view interval."""
You can’t perform that action at this time.
0 commit comments