Skip to content

MNT: Remove internal usage of the 'backend' key in rcParams - #32495

Open
timhoffm wants to merge 1 commit into
matplotlib:mainfrom
timhoffm:rcparams-remove-backend-key-usage
Open

timhoffm wants to merge 1 commit into
matplotlib:mainfrom
timhoffm:rcparams-remove-backend-key-usage

Conversation

@timhoffm

@timhoffm timhoffm commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

PR summary

Working towards #31791.

This removes most internal usages of the 'backend' key (some usage in tests is still in place because I have to decide there whether we still want to test the key API).

It's conceptually a schematic replacement

  • rcParams._get('backend') -> rcParams._backend - obtain raw backend value
  • x = rcParams['backend'] -> x = rcParams._get_backend_resolved() - obtain resoved backend
  • rcParams['backend'] = x -> rcParams._backend = x - store the value. Note that this write had no specific logic attatched. It's only be used to store the new backend value.

Note: There have been some places writing rcParamsDefault['backend'] and rcParamsOrig['backend']. These were needed to synchronize and persist backend information even after resetting rcParams. That's not needed anymore and thus removed now that the backend information only exists once as class attribute on RcParams.

Note2: In theory it would even be better to use RcParams._backend rather than access via instance rcParams._backend backend. I've not done that for now, because it would complicate the PR. We may do this in a followup.

AI Disclosure

No AI.

PR quality check

  • Use an expressive title, e.g. "Fix title font property precedence"
  • New and changed code is tested
  • N/A Plotting related features are demonstrated in an example
  • N/A New features and API changes have release notes
  • N/A Documentation complies with general and docstring guidelines

@timhoffm
timhoffm force-pushed the rcparams-remove-backend-key-usage branch 2 times, most recently from f0c47d3 to 271de55 Compare October 17, 2026 07:03
@timhoffm
timhoffm force-pushed the rcparams-remove-backend-key-usage branch from 271de55 to 9409506 Compare October 17, 2026 08:36

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant