Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 20200a5

Browse files
committed
tick_bottom/top
1 parent 8dac00d commit 20200a5

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

lib/matplotlib/axis.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1939,11 +1939,25 @@ def set_ticks_position(self, position):
19391939

19401940
def tick_top(self):
19411941
'use ticks only on top'
1942+
label = True
1943+
if 'label1On' in self._major_tick_kw:
1944+
label = (self._major_tick_kw['label1On']
1945+
or self._major_tick_kw['label2On'])
19421946
self.set_ticks_position('top')
1947+
# if labels were turned off before this was called
1948+
# leave them off
1949+
self.set_tick_params(which='both', labeltop=label)
19431950

19441951
def tick_bottom(self):
19451952
'use ticks only on bottom'
1953+
label = True
1954+
if 'label1On' in self._major_tick_kw:
1955+
label = (self._major_tick_kw['label1On']
1956+
or self._major_tick_kw['label2On'])
19461957
self.set_ticks_position('bottom')
1958+
# if labels were turned off before this was called
1959+
# leave them off
1960+
self.set_tick_params(which='both', labelbottom=label)
19471961

19481962
def get_ticks_position(self):
19491963
"""

0 commit comments

Comments
 (0)