Skip to content

Commit a21c97c

Browse files
jklymakQuLogic
andcommitted
Rewrite of constrained layout.
Apply suggestions from code review Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
1 parent 71de09a commit a21c97c

36 files changed

+1369
-1636
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Constrained layout rewrite
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
The layout manager ``constrained_layout`` was re-written with different
5+
outer constraints that should be more robust to complicated subplot layouts.
6+
User-facing changes are:
7+
8+
- some poorly constrained layouts will have different width/height plots than
9+
before.
10+
- colorbars now respect the ``anchor`` keyword argument of `.colorbar.make_axes`
11+
- colorbars are wider.
12+
- colorbars in different rows or columns line up more robustly.
13+
- *hspace* and *wspace* options to `.Figure.set_constrained_layout_pads`
14+
were twice as wide as the docs said they should be. So these now follow
15+
the docs.
16+
17+
This feature will remain "experimental" until the new changes have been
18+
used enough by users, so we anticipate version 3.5 or 3.6. On the other hand,
19+
``constrained_layout`` is extensively tested and used in examples in the
20+
library, so using it should be safe, but layouts may not be exactly the same
21+
as more development takes place.
22+
23+
Details of using ``constrained_layout``, and its algorithm are available at
24+
:doc:`/tutorials/intermediate/constrainedlayout_guide.html`

lib/matplotlib/_constrained_layout.py

Lines changed: 502 additions & 567 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)