Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0a4b52e

Browse filesBrowse files
committed
Handle case where there are no ticks
1 parent 0bf73c1 commit 0a4b52e
Copy full SHA for 0a4b52e

File tree

Expand file treeCollapse file tree

1 file changed

+8
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-2
lines changed

‎lib/matplotlib/axis.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axis.py
+8-2Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,8 +1108,14 @@ def get_tightbbox(self, renderer):
11081108
return None
11091109

11101110
def get_tick_padding(self):
1111-
return max(self.majorTicks[0].get_tick_padding(),
1112-
self.minorTicks[0].get_tick_padding())
1111+
values = []
1112+
if len(self.majorTicks):
1113+
values.append(self.majorTicks[0].get_tick_padding())
1114+
if len(self.minorTicks):
1115+
values.append(self.minorTicks[0].get_tick_padding())
1116+
if len(values):
1117+
return max(values)
1118+
return 0.0
11131119

11141120
@allow_rasterization
11151121
def draw(self, renderer, *args, **kwargs):

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.