MNT: Deprecate rcParams._get("backend")#30963
Draft
timhoffm wants to merge 1 commit intomatplotlib:mainfrom
Draft
MNT: Deprecate rcParams._get("backend")#30963timhoffm wants to merge 1 commit intomatplotlib:mainfrom
timhoffm wants to merge 1 commit intomatplotlib:mainfrom
Conversation
f343d24 to
7e92025
Compare
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.
7e92025 to
fc8fb3a
Compare
Member
Author
|
Still need to filter the deprecation warnings for internal use. |
QuLogic
reviewed
Jan 15, 2026
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.", | ||
| ) |
Member
There was a problem hiding this comment.
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.", | |
| ) |
QuLogic
reviewed
Jan 15, 2026
| "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 |
Member
There was a problem hiding this comment.
What is "this"? The comment is in an odd spot to decide if it's the if, the warning, or the whole method.
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
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.
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.