@@ -1938,12 +1938,30 @@ def set_ticks_position(self, position):
1938
1938
self
8000
.stale = True
1939
1939
1940
1940
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' ])
1942
1948
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 )
1943
1952
1944
1953
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' ])
1946
1961
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 )
1947
1965
1948
1966
def get_ticks_position (self ):
1949
1967
"""
@@ -2277,12 +2295,30 @@ def set_ticks_position(self, position):
2277
2295
self .stale = True
2278
2296
2279
2297
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' ])
2281
2305
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 )
2282
2309
2283
2310
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
8000
self ._major_tick_kw :
2316
+ label = (self ._major_tick_kw ['label1On' ]
2317
+ or self ._major_tick_kw ['label2On' ])
2285
2318
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 )
2286
2322
2287
2323
def get_ticks_position (self ):
2288
2324
"""
0 commit comments