From 93a6d4536d10501e81795da8545b0c9818a5efa3 Mon Sep 17 00:00:00 2001 From: hannah Date: Sat, 26 Nov 2022 18:04:55 -0500 Subject: [PATCH] Backport PR #24548: DOC: improved the doc for layout_engine.py --- lib/matplotlib/layout_engine.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/matplotlib/layout_engine.py b/lib/matplotlib/layout_engine.py index 11a0dc8c4fb9..49b3f1dd125f 100644 --- a/lib/matplotlib/layout_engine.py +++ b/lib/matplotlib/layout_engine.py @@ -5,9 +5,10 @@ `~.LayoutEngine` defined here (or *None* for no layout). At draw time ``figure.get_layout_engine().execute()`` is called, the goal of which is usually to rearrange Axes on the figure to produce a pleasing layout. This is -like a ``draw`` callback, however when printing we disable the layout engine -for the final draw and it is useful to know the layout engine while the figure -is being created, in particular to deal with colorbars. +like a ``draw`` callback but with two differences. First, when printing we +disable the layout engine for the final draw. Second, it is useful to know the +layout engine while the figure is being created. In particular, colorbars are +made differently with different layout engines (for historical reasons). Matplotlib supplies two layout engines, `.TightLayoutEngine` and `.ConstrainedLayoutEngine`. Third parties can create their own layout engine