@@ -210,7 +210,14 @@ def _set_labelrotation(self, labelrotation):
210
210
self ._labelrotation = (mode , angle )
211
211
212
212
def apply_tickdir (self , tickdir ):
213
- """Calculate ``self._pad`` and ``self._tickmarkers``."""
213
+ """Set tick direction. Valid values are 'out', 'in', 'inout'."""
214
+ if tickdir is None :
215
+ tickdir = mpl .rcParams [f'{ self .__name__ } .direction' ]
216
+ _api .check_in_list (['in' , 'out' , 'inout' ], tickdir = tickdir )
217
+ self ._tickdir = tickdir
218
+ self ._pad = self ._base_pad + self .get_tick_padding ()
219
+ self .stale = True
220
+ # Subclass overrides should compute _tickmarkers as appropriate here.
214
221
215
222
def get_tickdir (self ):
216
223
return self ._tickdir
@@ -445,19 +452,13 @@ def _get_text2_transform(self):
445
452
return self .axes .get_xaxis_text2_transform (self ._pad )
446
453
447
454
def apply_tickdir (self , tickdir ):
448
- """Set tick direction. Valid values are 'in', 'out', 'inout'."""
449
- if tickdir is None :
450
- tickdir = mpl .rcParams [f'{ self .__name__ } .direction' ]
451
- _api .check_in_list (['in' , 'out' , 'inout' ], tickdir = tickdir )
452
- self ._tickdir = tickdir
453
-
454
- if self ._tickdir == 'in' :
455
- self ._tickmarkers = (mlines .TICKUP , mlines .TICKDOWN )
456
- elif self ._tickdir == 'inout' :
457
- self ._tickmarkers = ('|' , '|' )
458
- else :
459
- self ._tickmarkers = (mlines .TICKDOWN , mlines .TICKUP )
460
- self ._pad = self ._base_pad + self .get_tick_padding ()
455
+ # docstring inherited
456
+ super ().apply_tickdir (tickdir )
457
+ self ._tickmarkers = {
458
+ 'out' : (mlines .TICKDOWN , mlines .TICKUP ),
459
+ 'in' : (mlines .TICKUP , mlines .TICKDOWN ),
460
+ 'inout' : ('|' , '|' ),
461
+ }[self ._tickdir ]
461
462
self .stale = True
462
463
463
464
def update_position (self , loc ):
@@ -518,17 +519,13 @@ def _get_text2_transform(self):
518
519
return self .axes .get_yaxis_text2_transform (self ._pad )
519
520
520
521
def apply_tickdir (self , tickdir ):
521
- if tickdir is None :
522
- tickdir = mpl .rcParams [f'{ self .__name__ } .direction' ]
523
- self ._tickdir = tickdir
524
-
525
- if self ._tickdir == 'in' :
526
- self ._tickmarkers = (mlines .TICKRIGHT , mlines .TICKLEFT )
527
- elif self ._tickdir == 'inout' :
528
- self ._tickmarkers = ('_' , '_' )
529
- else :
530
- self ._tickmarkers = (mlines .TICKLEFT , mlines .TICKRIGHT )
531
- self ._pad = self ._base_pad + self .get_tick_padding ()
522
+ # docstring inherited
523
+ super ().apply_tickdir (tickdir )
524
+ self ._tickmarkers = {
525
+ 'out' : (mlines .TICKLEFT , mlines .TICKRIGHT ),
526
+ 'in' : (mlines .TICKRIGHT , mlines .TICKLEFT ),
527
+ 'inout' : ('_' , '_' ),
528
+ }[self ._tickdir ]
532
529
self .stale = True
533
530
534
531
def update_position (self , loc ):
0 commit comments