MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / _check_layout_engines_compat

Method _check_layout_engines_compat

lib/matplotlib/figure.py:2669–2686  ·  view source on GitHub ↗

Helper for set_layout engine If the figure has used the old engine and added a colorbar then the value of colorbar_gridspec must be the same on the new engine.

(self, old, new)

Source from the content-addressed store, hash-verified

2667 super().pick(mouseevent)
2668
2669 def _check_layout_engines_compat(self, old, new):
2670 """
2671 Helper for set_layout engine
2672
2673 If the figure has used the old engine and added a colorbar then the
2674 value of colorbar_gridspec must be the same on the new engine.
2675 """
2676 if old is None or new is None:
2677 return True
2678 if old.colorbar_gridspec == new.colorbar_gridspec:
2679 return True
2680 # colorbar layout different, so check if any colorbars are on the
2681 # figure...
2682 for ax in self.axes:
2683 if hasattr(ax, '_colorbar'):
2684 # colorbars list themselves as a colorbar.
2685 return False
2686 return True
2687
2688 def set_layout_engine(self, layout=None, **kwargs):
2689 """

Callers 1

set_layout_engineMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected