Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

new "layout" class #20055

Closed
Closed
Milestone
@jklymak

Description

@jklymak

As a follow on to#19892

Currently we have two layout engines, and#19892 proposes to access them with afigure(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 classclass 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 fromFigure andGridspec, though it would add state back toFigure in thefig._layout parameter. To implement, we would add toFigure.draw():

ifself._layoutisnotNone:self._layout.execute()

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp