-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
[MNT]: API consistency for Figure layout_engine #29636
Copy link
Copy link
Open
Labels
API: changesChanges to the public API, typically requiring deprecation.Changes to the public API, typically requiring deprecation.API: consistencyConsistency of the matplotlib API, including naming, behavior, defaults, …Consistency of the matplotlib API, including naming, behavior, defaults, …Maintenance
Metadata
Metadata
Assignees
Labels
API: changesChanges to the public API, typically requiring deprecation.Changes to the public API, typically requiring deprecation.API: consistencyConsistency of the matplotlib API, including naming, behavior, defaults, …Consistency of the matplotlib API, including naming, behavior, defaults, …Maintenance
Type
Fields
Give feedbackNo fields configured for issues without a type.
Summary
Summary
Split out of #24617. Before we can implement this, we need a though API discussion (#24617 (comment)).
Current state:
figure(..., layout=...)set/get_layout_engine().I'm opposed to creating an alias
set_layout/set_layout_engine.We should converge to one name. While
layout_engineis more explicitlayoutseems good enough. If the name would only be used rarely I'd go with the longer option, but since we don't have a layout engine by default, people must often useplt.subplots(..., layout="constrained")andplt.subplots(..., layout_engine="constrained")is way too long to just create a figure.Semi-OT: I'm tempted to start a discussion whether we can make constrained layout the default. It is what people would want most of the time, and having to always explicitly enable it is a nuissance. Of course it's a significant change and imacts basically all figures created with matplotlib. OTOH it's "only" a shift of some of the graphic elements, which does not affect the visual expression of the figure - I claim most people would not notice. And if you want the previous behavior, you can set the layout engine to none.
Either way, if we want to move forward on the layout topic, we should agree on one name and slowly phase out the other. At least discourage, but possibly pending deprecate.
Proposed fix
No response