@@ -148,7 +148,7 @@ def __init__(self, axes, loc, label=None,
148148 grid_alpha = mpl .rcParams ["grid.alpha" ]
149149 grid_kw = {k [5 :]: v for k , v in kw .items ()}
150150
151- self .apply_tickdir (tickdir )
151+ self ._apply_tickdir (tickdir )
152152
153153 self .tick1line = mlines .Line2D (
154154 [], [],
@@ -209,15 +209,18 @@ def _set_labelrotation(self, labelrotation):
209209 _api .check_in_list (['auto' , 'default' ], labelrotation = mode )
210210 self ._labelrotation = (mode , angle )
211211
212- def apply_tickdir (self , tickdir ):
212+ def _apply_tickdir (self , tickdir ):
213213 """Set tick direction. Valid values are 'out', 'in', 'inout'."""
214+ # Overriding subclasses should also compute _tickmarkers here.
214215 if tickdir is None :
215216 tickdir = mpl .rcParams [f'{ self .__name__ } .direction' ]
216217 _api .check_in_list (['in' , 'out' , 'inout' ], tickdir = tickdir )
217218 self ._tickdir = tickdir
218219 self ._pad = self ._base_pad + self .get_tick_padding ()
219220 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" )
221224
222225 def get_tickdir (self ):
223226 return self ._tickdir
@@ -363,15 +366,15 @@ def _apply_params(self, **kw):
363366 # convenient to leave it here.
364367 self ._width = kw .pop ('width' , self ._width )
365368 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,
367370 # and also makes _tickmarkers.
368- self .apply_tickdir (kw .pop ('tickdir' , self ._tickdir ))
371+ self ._apply_tickdir (kw .pop ('tickdir' , self ._tickdir ))
369372 self .tick1line .set_marker (self ._tickmarkers [0 ])
370373 self .tick2line .set_marker (self ._tickmarkers [1 ])
371374 for line in (self .tick1line , self .tick2line ):
372375 line .set_markersize (self ._size )
373376 line .set_markeredgewidth (self ._width )
374- # _get_text1_transform uses _pad from apply_tickdir .
377+ # _get_text1_transform uses _pad from _apply_tickdir .
375378 trans = self ._get_text1_transform ()[0 ]
376379 self .label1 .set_transform (trans )
377380 trans = self ._get_text2_transform ()[0 ]
@@ -451,9 +454,9 @@ def _get_text1_transform(self):
451454 def _get_text2_transform (self ):
452455 return self .axes .get_xaxis_text2_transform (self ._pad )
453456
454- def apply_tickdir (self , tickdir ):
457+ def _apply_tickdir (self , tickdir ):
455458 # docstring inherited
456- super ().apply_tickdir (tickdir )
459+ super ()._apply_tickdir (tickdir )
457460 self ._tickmarkers = {
458461 'out' : (mlines .TICKDOWN , mlines .TICKUP ),
459462 'in' : (mlines .TICKUP , mlines .TICKDOWN ),
@@ -518,9 +521,9 @@ def _get_text1_transform(self):
518521 def _get_text2_transform (self ):
519522 return self .axes .get_yaxis_text2_transform (self ._pad )
520523
521- def apply_tickdir (self , tickdir ):
524+ def _apply_tickdir (self , tickdir ):
522525 # docstring inherited
523- super ().apply_tickdir (tickdir )
526+ super ()._apply_tickdir (tickdir )
524527 self ._tickmarkers = {
525528 'out' : (mlines .TICKLEFT , mlines .TICKRIGHT ),
526529 'in' : (mlines .TICKRIGHT , mlines .TICKLEFT ),
0 commit comments