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