Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0058693

Browse files
committed
FIX: let CL work with hidden axes
1 parent 667a100 commit 0058693

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/matplotlib/_constrained_layout.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,11 @@ def _make_layout_margins(ax, renderer, h_pad, w_pad):
272272
invTransFig = fig.transFigure.inverted().transform_bbox
273273
pos = ax.get_position(original=True)
274274
tightbbox = ax.get_tightbbox(renderer=renderer)
275-
bbox = invTransFig(tightbbox)
275+
if tightbbox is None:
276+
bbox = pos
277+
else:
278+
bbox = invTransFig(tightbbox)
279+
276280
# this can go wrong:
277281
if not (np.isfinite(bbox.width) and np.isfinite(bbox.height)):
278282
# just abort, this is likely a bad set of co-ordinates that

0 commit comments

Comments
 (0)