Skip to content

[ENH]: Support third-party layout engine string names #31328

@anntzer

Description

Problem

Currently, Figure.set_layout_engine only supports a hard-coded list of (string) engine names. In order to support the new "direct" layout engine, @jklymak had to patch that method (https://github.com/jklymak/mpl-direct-layout/blob/5f8549df76bf68de58c99aded3c6495754689655/src/mpl_direct_layout/_register.py#L10-L26; see #31312).

Proposed solution

It would be convenient if one could do e.g. figure.set_layout_engine("mpl_direct_layout:DirectLayoutEngine"), similarly to how one can do mpl.style.use("module.stylename"). Obviously one can already do from mpl_direct_layout import DirectLayoutEngine; figure.set_layout_engine(DirectLayoutEngine()); the point is to save the explicit import here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions