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

Skip to content

Commit 97b3985

Browse files
committed
Address comments in PR
1 parent 62804e8 commit 97b3985

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

lib/matplotlib/axis.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -176,13 +176,12 @@ def get_tick_padding(self):
176176
"""
177177
Get the length of the tick outside of the axes.
178178
"""
179-
tickdir = self._tickdir
180-
if tickdir == 'in':
181-
return 0.0
182-
elif tickdir == 'inout':
183-
return self._size / 2
184-
elif tickdir == 'out':
185-
return self._size
179+
padding = {
180+
'in': 0.0,
181+
'inout': 0.5,
182+
'out': 1.0
183+
}
184+
return self._size * padding[self._tickdir]
186185

187186
def get_children(self):
188187
children = [self.tick1line, self.tick2line,
@@ -1109,7 +1108,8 @@ def get_tightbbox(self, renderer):
11091108
return None
11101109

11111110
def get_tick_padding(self):
1112-
return self.majorTicks[0].get_tick_padding()
1111+
return max(self.majorTicks[0].get_tick_padding(),
1112+
self.minorTicks[0].get_tick_padding())
11131113

11141114
@allow_rasterization
11151115
def draw(self, renderer, *args, **kwargs):

0 commit comments

Comments
 (0)