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

[MNT]: Improve backend selection API #26406

Open
@timhoffm

Description

@timhoffm

Summary

We currently have:

  • matplotlib.use
  • matplotlib.get_backend
  • pyplot.switch_backend

Issues:

  • The namematplotlib.use is really obscure.
  • The difference betweenswitch_backend anduse is not quite clear.

Proposed fix

  • Consider renamingmatplotlib.use (and either discourace or long-term deprecateuse (with a pending deprecation)).
  • Check whetheruse andswitch_backend can be unified. If not, at least improve the documentation.

Side note: Theforce parameter inuse can be dropped.

matplotlib.use(..., force=True)

is equivalent to

try:    matplotlib.use(...)except ImportError:    pass

It should be rare that users want to ignore that changing the backend fails. And if so, they can do it explicitly. We do not need to provide API for that. The only slight complication is that this the default behavior is force=True; i.e. dropping would change the default behavor. But we can address that in the course of "renaming": We simply provide a new function, e.g.set_backend with the new behavior.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp