You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Regression on tight_layout when manually adding axes for colorbars #21749
When creating manual floating axes to fill with colorbars, previous to version 3.5 a call to fig.tight_layout() on a figure with manually located axes would simply raise a warning that the figure contains axes incompatbile with tight layout.
Starting in 3.5 we get the attribute error documented below.
~/.venv/envs/rms-2.0.0/lib/python3.9/site-packages/matplotlib/figure.py in tight_layout(self, pad, h_pad, w_pad, rect)
3181 from .tight_layout import (
3182 get_subplotspec_list, get_tight_layout_figure)
-> 3183 subplotspec_list = get_subplotspec_list(self.axes)
3184 if None in subplotspec_list:
3185 _api.warn_external("This figure includes Axes that are not "
~/.venv/envs/rms-2.0.0/lib/python3.9/site-packages/matplotlib/colorbar.py in get_subplotspec(self)
281 ss = getattr(self._cbar.ax, 'get_subplotspec', None)
282 if ss is None:
--> 283 ss = self._orig_locator.get_subplotspec()
284 else:
285 ss = ss()
AttributeError: 'NoneType' object has no attribute 'get_subplotspec'
Expected outcome
Expect a warning about tight layout used with incompatible axes
Activity
jklymak commentedon Nov 25, 2021
Thanks for the report. This shouldn't be too hard to fix, look for it in 3.5.1
jklymak commentedon Nov 25, 2021
Sorry this was broken - #21751 should fix it...