FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

MNT: Deprecate rcParams._get("backend") by timhoffm · Pull Request #30963 · matplotlib/matplotlib · GitHub

Repository navigation

MNT: Deprecate rcParams._get("backend") - #30963

Closed
timhoffm wants to merge 1 commit into
matplotlib:mainfrom
timhoffm:deprecate-_get_backend
Closed

timhoffm wants to merge 1 commit into
matplotlib:mainfrom
timhoffm:deprecate-_get_backend

Conversation

timhoffm commented Jan 14, 2026 •
edited
Loading

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.

timhoffm force-pushed the deprecate-_get_backend branch from f343d24 to 7e92025 Compare January 14, 2026 09:42
timhoffm added this to the v3.11.0 milestone Jan 14, 2026
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 force-pushed the deprecate-_get_backend branch from 7e92025 to fc8fb3a Compare January 14, 2026 12:22
timhoffm marked this pull request as draft January 14, 2026 13:23

Copy link
Copy Markdown
Member Author

Still need to filter the deprecation warnings for internal use.

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.",
)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.",
)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Please bump to 3.12 as well.

"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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

melissawm added API: changes Changes to the public API, typically requiring deprecation. Maintenance labels Jan 21, 2026
QuLogic modified the milestones: v3.11.0, v3.12.0 Mar 6, 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

timhoffm closed this May 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL