### Bug summary I think #21749 wasn't fully fixed. `mpl_toolkits.axes_grid1.inset_locator.inset_axes` still appears to be affected. This still throws in v3.5.1: ### Code for reproduction ```python import matplotlib import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1.inset_locator import inset_axes matplotlib.__version__ # > '3.5.1' fig, ax = plt.subplots(1, 1) pts = ax.scatter([0, 1], [0, 1], c=[1, 5]) cax = inset_axes(ax, width="3%", height="70%") plt.colorbar(pts, cax=cax) plt.tight_layout() ``` ### Actual outcome ```py AttributeError: 'AnchoredSizeLocator' object has no attribute 'get_subplotspec' ``` ### Expected outcome No error ### Additional information _No response_ ### Operating system _No response_ ### Matplotlib Version 3.5.1 ### Matplotlib Backend module://matplotlib_inline.backend_inline ### Python version 3.10.2 ### Jupyter version _No response_ ### Installation pip
Activity
[-][Bug]: [/-][+][Bug]: `inset_axes` colorbar + `tight_layout` raises `AttributeError`[/+]QuLogic commentedon Mar 5, 2022
This bug is specific to the toolkit inset Axes. Using a standard inset Axes does work:
jklymak commentedon Mar 5, 2022
Agreed but there is something wrong in the logic detecting if the axes is a subplot spec or not.
Sorry for my temporary absence but I am away from strong enough internet to interact heavily with GitHub.
fix plt.tight_layout() throwing AttributeError on density_hexbin plots (
fix plt.tight_layout() throwing AttributeError on density_hexbin plots (
fix plt.tight_layout() throwing AttributeError on density_hexbin plots (