Skip to content

Commit 6ee34f2

Browse files
committed
Handle case where there are no ticks
1 parent 5777bf3 commit 6ee34f2

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/matplotlib/axis.py

Lines 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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy