@@ -1937,12 +1937,30 @@ def set_ticks_position(self, position):
1937
1937
self .stale = True
1938
1938
1939
1939
def tick_top (self ):
1940
- 'use ticks only on top'
1940
+ """
1941
+ Move ticks and ticklabels (if present) to the top of the axes.
1942
+ """
1943
+ label = True
1944
+ if 'label1On' in self ._major_tick_kw :
1945
+ label = (self ._major_tick_kw ['label1On' ]
1946
+ or self ._major_tick_kw ['label2On' ])
1941
1947
self .set_ticks_position ('top' )
1948
+ # if labels were turned off before this was called
1949
+ # leave them off
1950
+ self .set_tick_params (which = 'both' , labeltop = label )
1942
1951
1943
1952
def tick_bottom (self ):
1944
- 'use ticks only on bottom'
1953
+ """
1954
+ Move ticks and ticklabels (if present) to the bottom of the axes.
1955
+ """
1956
+ label = True
1957
+ if 'label1On' in self ._major_tick_kw :
1958
+ label = (self ._major_tick_kw ['label1On' ]
1959
+ or self ._major_tick_kw ['label2On' ])
1945
1960
self .set_ticks_position ('bottom' )
1961
+ # if labels were turned off before this was called
1962
+ # leave them off
1963
+ self .set_tick_params (which = 'both' , labelbottom = label )
1946
1964
1947
1965
def get_ticks_position (self ):
1948
1966
"""
@@ -2273,12 +2291,30 @@ def set_ticks_position(self, position):
2273
2291
self .stale = True
2274
2292
2275
2293
def tick_right (self ):
2276
- 'use ticks only on right'
2294
+ """
2295
+ Move ticks and ticklabels (if present) to the right of the axes.
2296
+ """
2297
+ label = True
2298
+ if 'label1On' in self ._major_tick_kw :
2299
+ label = (self ._major_tick_kw ['label1On' ]
2300
+ or self ._major_tick_kw ['label2On' ])
2277
2301
self .set_ticks_position ('right' )
2302
+ # if labels were turned off before this was called
2303
+ # leave them off
2304
+ self .set_tick_params (which = 'both' , labelright = label )
2278
2305
2279
2306
def tick_left (self ):
2280
- 'use ticks only on left'
2307
+ """
2308
+ Move ticks and ticklabels (if present) to the left of the axes.
2309
+ """
2310
+ label = True
2311
+ if 'label1On' in self ._major_tick_kw :
2312
+ label = (self ._major_tick_kw ['label1On' ]
2313
+ or self ._major_tick_kw ['label2On' ])
2281
2314
self .set_ticks_position ('left' )
2315
+ # if labels were turned off before this was called
2316
+ # leave them off
2317
+ self .set_tick_params (which = 'both' , labelleft = label )
2282
2318
2283
2319
def get_ticks_position (self ):
2284
2320
"""
0 commit comments