From ab2b1fc5a69d6155c2816d5a98f945119b6f5ae9 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 17 Nov 2014 13:49:42 -0500 Subject: [PATCH] Fix tight bounding box calculation in axes-free figure --- lib/matplotlib/figure.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/matplotlib/figure.py b/lib/matplotlib/figure.py index 2fd9286b75da..129dee3e88b9 100644 --- a/lib/matplotlib/figure.py +++ b/lib/matplotlib/figure.py @@ -1610,6 +1610,9 @@ def get_tightbbox(self, renderer): if ax.get_visible(): bb.append(ax.get_tightbbox(renderer)) + if len(bb) == 0: + return self.bbox_inches + _bbox = Bbox.union([b for b in bb if b.width != 0 or b.height != 0]) bbox_inches = TransformedBbox(_bbox,