Skip to content

Commit aa5537a

Browse files
committed
FIX: don't include text at -inf in bbox
1 parent 9d81809 commit aa5537a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/matplotlib/axis.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,8 +1145,10 @@ def get_tightbbox(self, renderer):
11451145
bb = []
11461146

11471147
for a in [self.label, self.offsetText]:
1148-
if a.get_visible():
1149-
bb.append(a.get_window_extent(renderer))
1148+
bbox = a.get_window_extent(renderer)
1149+
if (np.isfinite(bbox.width) and np.isfinite(bbox.height) and
1150+
a.get_visible()):
1151+
bb.append(bbox)
11501152

11511153
bb.extend(ticklabelBoxes)
11521154
bb.extend(ticklabelBoxes2)

0 commit comments

Comments
 (0)