@@ -111,6 +111,8 @@ def auto_adjust_subplotpars(
111
111
if all (not ax .get_visible () for ax in subplots ):
112
112
continue
113
113
114
+
115
+
114
116
tight_bbox_raw = union ([ax .get_tightbbox (renderer ) for ax in subplots
115
117
if ax .get_visible ()])
116
118
tight_bbox = TransformedBbox (tight_bbox_raw ,
@@ -176,11 +178,13 @@ def auto_adjust_subplotpars(
176
178
margin_right = 0.4999
177
179
warnings .warn ('The left and right margins cannot be made large '
178
180
'enough to accommodate all axes decorations. ' )
181
+ return None
179
182
if margin_bottom + margin_top >= 1 :
180
183
margin_bottom = 0.4999
181
184
margin_top = 0.4999
182
185
warnings .warn ('The bottom and top margins cannot be made large '
183
186
'enough to accommodate all axes decorations. ' )
187
+ return None
184
188
185
189
kwargs = dict (left = margin_left ,
186
190
right = 1 - margin_right ,
@@ -302,7 +306,10 @@ def get_tight_layout_figure(fig, axes_list, subplotspec_list, renderer,
302
306
for ax , subplotspec in zip (axes_list , subplotspec_list ):
303
307
if subplotspec is None :
304
308
continue
305
-
309
+ # spines have a problem under zoom; CL ignores zoom events. TL
310
+ # ignores spines...
311
+ for spine in ['left' , 'right' , 'bottom' , 'top' ]:
312
+ ax .spines [spine ].set_in_layout (False )
306
313
subplots = subplot_dict .setdefault (subplotspec , [])
307
314
308
315
if not subplots :
@@ -354,6 +361,8 @@ def get_tight_layout_figure(fig, axes_list, subplotspec_list, renderer,
354
361
subplot_list = subplot_list ,
355
362
ax_bbox_list = ax_bbox_list ,
356
363
pad = pad , h_pad = h_pad , w_pad = w_pad )
364
+ if kwargs is None :
365
+ return None
357
366
358
367
if rect is not None :
359
368
# if rect is given, the whole subplots area (including
@@ -384,5 +393,7 @@ def get_tight_layout_figure(fig, axes_list, subplotspec_list, renderer,
384
393
ax_bbox_list = ax_bbox_list ,
385
394
pad = pad , h_pad = h_pad , w_pad = w_pad ,
386
395
rect = (left , bottom , right , top ))
396
+ if kwargs is None :
397
+ return None
387
398
388
399
return kwargs
0 commit comments