Skip to content

Commit f5f7580

Browse files
committed
Error check
1 parent acbd1c3 commit f5f7580

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/matplotlib/_constrained_layout.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,11 @@ def _make_layout_margins(ax, renderer, h_pad, w_pad):
258258
fig = ax.figure
259259
invTransFig = fig.transFigure.inverted().transform_bbox
260260
pos = ax.get_position(original=True)
261-
tightbbox = ax.get_tightbbox(renderer=renderer, for_layout_only=True)
261+
try:
262+
tightbbox = ax.get_tightbbox(renderer=renderer, for_layout_only=True)
263+
except:
264+
tightbbox = ax.get_tightbbox(renderer=renderer)
265+
262266
if tightbbox is None:
263267
bbox = pos
264268
else:

0 commit comments

Comments
 (0)