Closed
Description
Bug report
Bug summary
Not sure if this an expected behaviour, but the colorbar seems to be ignored when using tight_layout
. Example taken from the "Constrained Layout Guide" (https://matplotlib.org/3.1.3/tutorials/intermediate/constrainedlayout_guide.html#colorbars).
Code for reproduction
arr = np.arange(100).reshape((10, 10))
fig, axs = plt.subplots(2, 2, figsize=(4, 4), constrained_layout=True)
for ax in axs.flat:
im = ax.pcolormesh(arr)
fig.colorbar(im, ax=axs, shrink=0.6)
plt.tight_layout()
Actual outcome
Expected outcome
This is the outcome before calling plt.tight_layout()
Matplotlib version
- Operating system: Fedora 31
- Matplotlib version: 3.1.3 from conda defaults (3.2.1 from conda-forge behave similarly)
- Matplotlib backend (
print(matplotlib.get_backend())
): Qt5Agg - Python version: 3.7.6
- Jupyter version (if applicable):
- Other libraries: