8000 constrained_layout fails on suptitle+colorbars+some figure sizes · Issue #17712 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
constrained_layout fails on suptitle+colorbars+some figure sizes #17712
Closed
@anntzer

Description

@anntzer

Bug report

Bug summary

After

from pylab import *

fig = plt.figure(figsize=(8, 5), constrained_layout=True)
fig.suptitle("foo")
axs = fig.subplots(1, 2, sharex=True, sharey=True)
im = axs[0].imshow([[1, 2], [3, 4]])
fig.colorbar(im, ax=axs[0], orientation="horizontal")
im = axs[1].imshow([[1, 2], [3, 4]])
fig.colorbar(im, ax=axs[1], orientation="horizontal")
plt.show()

and toggling manually to fullscreen, one gets
test
i.e. the suptitle is placed too low.

Note that this doesn't happen if the call to suptitle() comes last instead of first.

Matplotlib version

  • Operating system: linux
  • Matplotlib version: master
  • Matplotlib backend (print(matplotlib.get_backend())): gui+agg/mplcairo
  • Python version: 38
  • Jupyter version (if applicable):
  • Other libraries:

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: geometry managerLayoutEngine, Constrained layout, Tight layout

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0