GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — MNT: Deprecate rcParams._get("backend") by timhoffm · Pull Request #30963 · matplotlib/matplotlib

Conversation

@timhoffm

@timhoffm timhoffm commented Jan 14, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

since 3.10 we have the official API matplotlib.get_backend (auto_select=False). No problems have been reported and matplotlib-inline is using it. Therefore, I remove the provisional status from the auto-select flag.

Additionally, I deprecate the API rcParams._get('backend'), which the above is replacing.

It seems that rcParams._get("backend") is not used anywhere publically, but let's still be defensive and deprecate.

https://github.com/search?q=%2F%5C._get%5C%28%5B%22%27%5Dbackend%5B%22%27%5D%5C%29%2F+language%3APython+NOT+is%3Afork+NOT+path%3A**%2Fmatplotlib%2F**+NOT+path%3A**%2Fsite-packages**+NOT+path%3A**%2Fpyplot.py&type=code

This is working towards removal of dynamic backend state from rcParams #26406.
Follow-up to #29039.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@timhoffm
timhoffm force-pushed the deprecate-_get_backend branch from f343d24 to 7e92025 Compare January 14, 2026 09:42
@timhoffm timhoffm added this to the v3.11.0 milestone Jan 14, 2026
@timhoffm
MNT: Deprecate rcParams._get("backend")
fc8fb3a
since 3.10 we have the official API `matplotlib.get_backend
(auto_select=False)`. No problems have been reported and
matplotlib-inline is using it https://github
.com/ipython/matplotlib-inline/pull/38. Therefore, I remove the
provisional status from the auto-select flag.

Additionally, I deprecate the API rcParams._get('backend'), which the
above is replacing.

It seems that `rcParams._get("backend")` is not used anywhere
publically, but let's still be defensive and deprecate.

https://github.com/search?q=%2F%5C._get%5C%28%5B%22%27%5Dbackend%5B%22%27%5D%5C%29%2F+language%3APython+NOT+is%3Afork+NOT+path%3A**%2Fmatplotlib%2F**+NOT+path%3A**%2Fsite-packages**+NOT+path%3A**%2Fpyplot.py&type=code

This is working towards matplotlib#26406.
Follow-up to matplotlib#29039.
@timhoffm
timhoffm force-pushed the deprecate-_get_backend branch from 7e92025 to fc8fb3a Compare January 14, 2026 12:22
@timhoffm
timhoffm marked this pull request as draft January 14, 2026 13:23
@timhoffm

timhoffm commented Jan 14, 2026

Copy link
Copy Markdown
Member Author

Still need to filter the deprecation warnings for internal use.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

QuLogic
QuLogic reviewed Jan 15, 2026
View reviewed changes
Comment thread lib/matplotlib/__init__.py
Comment on lines +716 to +720
_api.warn_deprecated(
"rcParams._get('backend') is deprecated since Matplotlib 3.11. "
"Use matplotlib.get_backend(auto_select=False) instead, which is "
"available since Matplotlib 3.10.",
)

@QuLogic QuLogic Jan 15, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first arg is since, not the full message.

Suggested change
_api.warn_deprecated(
"rcParams._get('backend') is deprecated since Matplotlib 3.11. "
"Use matplotlib.get_backend(auto_select=False) instead, which is "
"available since Matplotlib 3.10.",
)
_api.warn_deprecated(
"3.11",
name="rcParams._get('backend')",
addendum="Use matplotlib.get_backend(auto_select=False) instead, which is "
"available since Matplotlib 3.10.",
)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@QuLogic QuLogic Apr 25, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please bump to 3.12 as well.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
QuLogic
QuLogic reviewed Jan 15, 2026
View reviewed changes
Comment thread lib/matplotlib/__init__.py
"Use matplotlib.get_backend(auto_select=False) instead, which is "
"available since Matplotlib 3.10.",
)
# TODO: When removing this, also remove the suppression context in

@QuLogic QuLogic Jan 15, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is "this"? The comment is in an odd spot to decide if it's the if, the warning, or the whole method.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@melissawm melissawm added API: changes Changes to the public API, typically requiring deprecation. Maintenance labels Jan 21, 2026
@QuLogic QuLogic modified the milestones: v3.11.0, v3.12.0 Mar 6, 2026
@timhoffm timhoffm mentioned this pull request May 31, 2026
[MNT]: Remove backend state handling from rcParams #31791
Open
1 of 4 tasks
@timhoffm

timhoffm commented May 31, 2026

Copy link
Copy Markdown
Member Author

Deprecation is too complicated as long as we also need to use the API internally. Trying to silence deprecation warnings on internal usage turned out to be a deep rabbit hole. Closing in favor of #31791

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@timhoffm timhoffm closed this May 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@QuLogic QuLogic QuLogic left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

API: changes Changes to the public API, typically requiring deprecation. Maintenance

Projects

None yet

Milestone

v3.12.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@timhoffm @QuLogic @melissawm
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.