@@ -2313,7 +2313,9 @@ def _check_layout_engines_compat(self, old, new):
2313
2313
If the figure has used the old engine and added a colorbar then the
2314
2314
value of colorbar_gridspec must be the same on the new engine.
2315
2315
"""
2316
- if old is None or old .colorbar_gridspec == new .colorbar_gridspec :
2316
+ if old is None or new is None :
2317
+ return True
2318
+ if old .colorbar_gridspec == new .colorbar_gridspec :
2317
2319
return True
2318
2320
# colorbar layout different, so check if any colorbars are on the
2319
2321
# figure...
@@ -2329,10 +2331,12 @@ def set_layout_engine(self, layout=None, **kwargs):
2329
2331
2330
2332
Parameters
2331
2333
----------
2332
- layout: {'constrained', 'tight'} or `~.LayoutEngine`
2334
+ layout: {'constrained', 'tight', 'none' } or `~.LayoutEngine`
2333
2335
'constrained' will use `~.ConstrainedLayoutEngine`, 'tight' will
2334
2336
use `~.TightLayoutEngine`. Users and libraries can define their
2335
2337
own layout engines as well.
2338
+
2339
+ The string 'none' removes layout engine.
2336
2340
kwargs: dict
2337
2341
The keyword arguments are passed to the layout engine to set things
2338
2342
like padding and margin sizes. Only used if *layout* is a string.
@@ -2349,6 +2353,8 @@ def set_layout_engine(self, layout=None, **kwargs):
2349
2353
new_layout_engine = TightLayoutEngine (** kwargs )
2350
2354
elif layout == 'constrained' :
2351
2355
new_layout_engine = ConstrainedLayoutEngine (** kwargs )
2356
+ elif layout == 'none' :
2357
+ new_layout_engine = None
2352
2358
elif isinstance (layout , LayoutEngine ):
2353
2359
new_layout_engine = layout
2354
2360
else :
0 commit comments