8000 Make tick_left/right keep labels off if they are already off by jklymak · Pull Request #9670 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Make tick_left/right keep labels off if they are already off #9670

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Nov 13, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make tick_left/right keep labels off if they are already off
  • Loading branch information
jklymak committed Nov 2, 2017
commit 555171fc31bf44f6f283f5bb00f092afb4b5c412
12 changes: 8 additions & 4 deletions lib/matplotlib/axis.py
Original file line number Diff line number Diff line change
Expand Up @@ -2275,17 +2275,21 @@ def set_ticks_position(self, position):

def tick_right(self):
'use ticks only on right'
label = (self._major_tick_kw['label1On']
or self._major_tick_kw['label2On'])
label = True
if 'label1On' in self._major_tick_kw:
label = (self._major_tick_kw['label1On']
or self._major_tick_kw['label2On'])
self.set_ticks_position('right')
# if labels were turned off before this was called
# leave them off
self.set_tick_params(which='both', labelright=label)

def tick_left(self):
'use ticks only on left'
label = (self._major_tick_kw['label1On']
or self._major_tick_kw['label2On'])
label = True
if 'label1On' in self._major_tick_kw:
label = (self._major_tick_kw['label1On']
or self._major_tick_kw['label2On'])
self.set_ticks_position('left')
# if labels were turned off before this was called
# leave them off
Expand Down
0