@@ -1938,12 +1938,30 @@ def set_ticks_position(self, position):
19381938 self .stale = True
19391939
19401940 def tick_top (self ):
1941- 'use ticks only on top'
1941+ """
1942+ Move ticks and ticklabels (if present) to the top of the axes.
1943+ """
1944+ label = True
1945+ if 'label1On' in self ._major_tick_kw :
1946+ label = (self ._major_tick_kw ['label1On' ]
1947+ or self ._major_tick_kw ['label2On' ])
19421948 self .set_ticks_position ('top' )
1949+ # if labels were turned off before this was called
1950+ # leave them off
1951+ self .set_tick_params (which = 'both' , labeltop = label )
19431952
19441953 def tick_bottom (self ):
1945- 'use ticks only on bottom'
1954+ """
1955+ Move ticks and ticklabels (if present) to the bottom of the axes.
1956+ """
1957+ label = True
1958+ if 'label1On' in self ._major_tick_kw :
1959+ label = (self ._major_tick_kw ['label1On' ]
1960+ or self ._major_tick_kw ['label2On' ])
19461961 self .set_ticks_position ('bottom' )
1962+ # if labels were turned off before this was called
1963+ # leave them off
1964+ self .set_tick_params (which = 'both' , labelbottom = label )
19471965
19481966 def get_ticks_position (self ):
19491967 """
@@ -2277,12 +2295,30 @@ def set_ticks_position(self, position):
22772295 self .stale = True
22782296
22792297 def tick_right (self ):
2280- 'use ticks only on right'
2298+ """
2299+ Move ticks and ticklabels (if present) to the right of the axes.
2300+ """
2301+ label = True
2302+ if 'label1On' in self ._major_tick_kw :
2303+ label = (self ._major_tick_kw ['label1On' ]
2304+ or self ._major_tick_kw ['label2On' ])
22812305 self .set_ticks_position ('right' )
2306+ # if labels were turned off before this was called
2307+ # leave them off
2308+ self .set_tick_params (which = 'both' , labelright = label )
22822309
22832310 def tick_left (self ):
2284- 'use ticks only on left'
2311+ """
2312+ Move ticks and ticklabels (if present) to the left of the axes.
2313+ """
2314+ label = True
2315+ if 'label1On' in self ._major_tick_kw :
2316+ label = (self ._major_tick_kw ['label1On' ]
2317+ or self ._major_tick_kw ['label2On' ])
22852318 self .set_ticks_position ('left' )
2319+ # if labels were turned off before this was called
2320+ # leave them off
2321+ self .set_tick_params (which = 'both' , labelleft = label )
22862322
22872323 def get_ticks_position (self ):
22882324 """
0 commit comments