Skip to content

Rewrite of constrained_layout.... #17494

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions doc/api/next_api_changes/behavior/17494-JMK.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Constrained layout rewrite
~~~~~~~~~~~~~~~~~~~~~~~~~~

The layout manager ``constrained_layout`` was re-written with different
outer constraints that should be more robust to complicated subplot layouts.
User-facing changes are:

- some poorly constrained layouts will have different width/height plots than
before.
- colorbars now respect the ``anchor`` keyword argument of
`matplotlib.colorbar.make_axes`
- colorbars are wider.
- colorbars in different rows or columns line up more robustly.
- *hspace* and *wspace* options to `.Figure.set_constrained_layout_pads`
were twice as wide as the docs said they should be. So these now follow
the docs.

This feature will remain "experimental" until the new changes have been
used enough by users, so we anticipate version 3.5 or 3.6. On the other hand,
``constrained_layout`` is extensively tested and used in examples in the
library, so using it should be safe, but layouts may not be exactly the same
as more development takes place.

Details of using ``constrained_layout``, and its algorithm are available at
:doc:`/tutorials/intermediate/constrainedlayout_guide`
1,070 changes: 507 additions & 563 deletions lib/matplotlib/_constrained_layout.py

Large diffs are not rendered by default.

Loading