@@ -148,7 +148,7 @@ def __init__(self, axes, loc, label=None,
148
148
grid_alpha = mpl .rcParams ["grid.alpha" ]
149
149
grid_kw = {k [5 :]: v for k , v in kw .items ()}
150
150
151
- self .apply_tickdir (tickdir )
151
+ self ._apply_tickdir (tickdir )
152
152
153
153
self .tick1line = mlines .Line2D (
154
154
[], [],
@@ -209,15 +209,18 @@ def _set_labelrotation(self, labelrotation):
209
209
_api .check_in_list (['auto' , 'default' ], labelrotation = mode )
210
210
self ._labelrotation = (mode , angle )
211
211
212
- def apply_tickdir (self , tickdir ):
212
+ def _apply_tickdir (self , tickdir ):
213
213
"""Set tick direction. Valid values are 'out', 'in', 'inout'."""
214
+ # Overriding subclasses should also compute _tickmarkers here.
214
215
if tickdir is None :
215
216
tickdir = mpl .rcParams [f'{ self .__name__ } .direction' ]
216
217
_api .check_in_list (['in' , 'out' , 'inout' ], tickdir = tickdir )
217
218
self ._tickdir = tickdir
218
219
self ._pad = self ._base_pad + self .get_tick_padding ()
219
220
self .stale = True
220
- # Subclass overrides should compute _tickmarkers as appropriate here.
221
+
222
+ apply_tickdir = _api .deprecate_privatize_attribute (
223
+ "3.5" , alternative = "axis.set_tick_params" )
221
224
222
225
def get_tickdir (self ):
223
226
return self ._tickdir
@@ -363,15 +366,15 @@ def _apply_params(self, **kw):
363
366
# convenient to leave it here.
364
367
self ._width = kw .pop ('width' , self ._width )
365
368
self ._base_pad = kw .pop ('pad' , self ._base_pad )
366
- # apply_tickdir uses _size and _base_pad to make _pad,
369
+ # _apply_tickdir uses _size and _base_pad to make _pad,
367
370
# and also makes _tickmarkers.
368
- self .apply_tickdir (kw .pop ('tickdir' , self ._tickdir ))
371
+ self ._apply_tickdir (kw .pop ('tickdir' , self ._tickdir ))
369
372
self .tick1line .set_marker (self ._tickmarkers [0 ])
370
373
self .tick2line .set_marker (self ._tickmarkers [1 ])
371
374
for line in (self .tick1line , self .tick2line ):
372
375
line .set_markersize (self ._size )
373
376
line .set_markeredgewidth (self ._width )
374
- # _get_text1_transform uses _pad from apply_tickdir .
377
+ # _get_text1_transform uses _pad from _apply_tickdir .
375
378
trans = self ._get_text1_transform ()[0 ]
376
379
self .label1 .set_transform (trans )
377
380
trans = self ._get_text2_transform ()[0 ]
@@ -451,9 +454,9 @@ def _get_text1_transform(self):
451
454
def _get_text2_transform (self ):
452
455
return self .axes .get_xaxis_text2_transform (self ._pad )
453
456
454
- def apply_tickdir (self , tickdir ):
457
+ def _apply_tickdir (self , tickdir ):
455
458
# docstring inherited
456
- super ().apply_tickdir (tickdir )
459
+ super ()._apply_tickdir (tickdir )
457
460
self ._tickmarkers = {
458
461
'out' : (mlines .TICKDOWN , mlines .TICKUP ),
459
462
'in' : (mlines .TICKUP , mlines .TICKDOWN ),
@@ -518,9 +521,9 @@ def _get_text1_transform(self):
518
521
def _get_text2_transform (self ):
519
522
return self .axes .get_yaxis_text2_transform (self ._pad )
520
523
521
- def apply_tickdir (self , tickdir ):
524
+ def _apply_tickdir (self , tickdir ):
522
525
# docstring inherited
523
- super ().apply_tickdir (tickdir )
526
+ super ()._apply_tickdir (tickdir )
524
527
self ._tickmarkers = {
525
528
'out' : (mlines .TICKLEFT , mlines .TICKRIGHT ),
526
529
'in' : (mlines .TICKRIGHT , mlines .TICKLEFT ),
0 commit comments