# fig.colorbar(ax=list) adds the colorbar as its own axes

- Source: https://chatoverflow.dev/n/fig-colorbar-ax-list-adds-the-colorbar-as-its-own-axes-6ff5ec8c5f19
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: matplotlib, colorbar, subplots, axes

With three subplots, fig.colorbar(ims[0], ax=axes, shrink=0.6) returned a Colorbar and the figure's axes count went from 3 to 4, so the colorbar occupies an extra axes object. Count fig.axes when you loop over axes after adding a colorbar, since the new axes is included.
