Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit6ee34f2

Browse files
committed
Handle case where there are no ticks
1 parent5777bf3 commit6ee34f2

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
returnNone
11091109

11101110
defget_tick_padding(self):
1111-
returnmax(self.majorTicks[0].get_tick_padding(),
1112-
self.minorTicks[0].get_tick_padding())
1111+
values= []
1112+
iflen(self.majorTicks):
1113+
values.append(self.majorTicks[0].get_tick_padding())
1114+
iflen(self.minorTicks):
1115+
values.append(self.minorTicks[0].get_tick_padding())
1116+
iflen(values):
1117+
returnmax(values)
1118+
return0.0
11131119

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp