You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently we have two layout engines, and #19892 proposes to access them with a figure(layout='constrained'/'tight') kwarg and to discourage constrained_layout=True and tight_layout=True.
As a follow up, it would be good to create a new base class class Layout (or FigureLayout) that has subclasses class ConstrainedLayout and class TightLayout but could also have more, and/or user-defined subclasses. This would improve option handling: figure(layout=ConstrainedLayout(wspace=0.2)) instead of passing a hard-to-document dict.
The parent would probably need an __init__ and an execute method, and probably a bunch of setters for the various settings.
This would give us scope to define more layout engines or light wrappers around the existing ones. For instance, a frequently asked one, which is in proplot, is to have an inside-out layout where the axes sizes are fixed and the figure grows or shrinks to accommodate.
This would make the layout manager hot swappable as well, if it only did all its work at draw.
This would also remove state from Figure and Gridspec, though it would add state back to Figure in the fig._layout parameter. To implement, we would add to Figure.draw():
ifself._layoutisnotNone:
self._layout.execute()
The text was updated successfully, but these errors were encountered:
As a follow on to #19892
Currently we have two layout engines, and #19892 proposes to access them with a
figure(layout='constrained'/'tight')
kwarg and to discourageconstrained_layout=True
andtight_layout=True
.As a follow up, it would be good to create a new base class
class Layout
(orFigureLayout
) that has subclassesclass ConstrainedLayout
andclass TightLayout
but could also have more, and/or user-defined subclasses. This would improve option handling:figure(layout=ConstrainedLayout(wspace=0.2))
instead of passing a hard-to-document dict.The parent would probably need an
__init__
and anexecute
method, and probably a bunch of setters for the various settings.This would give us scope to define more layout engines or light wrappers around the existing ones. For instance, a frequently asked one, which is in proplot, is to have an inside-out layout where the axes sizes are fixed and the figure grows or shrinks to accommodate.
This would make the layout manager hot swappable as well, if it only did all its work at draw.
This would also remove state from
Figure
andGridspec
, though it would add state back toFigure
in thefig._layout
parameter. To implement, we would add toFigure.draw()
:The text was updated successfully, but these errors were encountered: