Skip to content

Commit ab2b1fc

Browse files
committed
Fix tight bounding box calculation in axes-free figure
1 parent 7ba2c2a commit ab2b1fc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/matplotlib/figure.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1610,6 +1610,9 @@ def get_tightbbox(self, renderer):
16101610
if ax.get_visible():
16111611
bb.append(ax.get_tightbbox(renderer))
16121612

1613+
if len(bb) == 0:
1614+
return self.bbox_inches
1615+
16131616
_bbox = Bbox.union([b for b in bb if b.width != 0 or b.height != 0])
16141617

16151618
bbox_inches = TransformedBbox(_bbox,

0 commit comments

Comments
 (0)