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 — Fix incompatibility with matplotlib 3.5.0-3.9.x by jwhiss · Pull Request #70 · ipython/matplotlib-inline

Conversation

@jwhiss

@jwhiss jwhiss commented Sep 21, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

Summary

This PR fixes #54 and the same issue I personally experienced with Matplotlib 3.6.3 and Python 3.11 by adding a compatibility branch in _enable_matplotlib_integration for Matplotlib versions >= 3.5.0 and < 3.10.0, using matplotlib.get_backend() without arguments.

Background

In Matplotlib 3.5.0, the private _get() function was removed and replaced by get_backend() for retrieving the current backend. get_backend() accepted no arguments through Matplotlib 3.9.x.

However, _enable_matplotlib_integration currently attempts to use matplotlib.rcParams._get("backend") for Matplotlib versions before 3.10.0. This causes the integration to fail with Matplotlib >= 3.5.0 < 3.10 because _get() is no longer available.

Changes

This change uses:

  • matplotlib.get_backend(auto_select=False) for Matplotlib >= 3.10.0
  • matplotlib.get_backend() for Matplotlib >= 3.5.0 and < 3.10.0
  • matplotlib.rcParams._get("backend") for older Matplotlib versions

Testing

Confirmed that Matplotlib 3.5.0 and 3.6.3 do not include _get().

Tested with Matplotlib 3.6.3 and confirmed that _enable_matplotlib_integration successfully retrieves the backend without raising an AttributeError.

Included a CI test that verifies Matplotlib 3.5.0 and 3.9.9 work with the matplotlib.rcParams.get_backend() function.

Tested that the modified function works correctly with Python 3.10 and Python 3.11.

Sorry, something went wrong.

Uh oh!

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

All reactions
@jwhiss
_enable_matplotlib_integration: fix version incompatibility
4ea04b4
Copilot AI lite review requested due to automatic review settings September 21, 2026 20:42
Copilot started reviewing on behalf of jwhiss September 21, 2026 20:43
View session
Copilot AI reviewed Sep 21, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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.

Copilot review overview

🟢 Approval recommended

No unresolved review issues were identified.

Review effort: Lite
Findings: None

What changed in this PR

Fixes Matplotlib backend retrieval compatibility across versions 3.5–3.9 while preserving support for older and newer releases.

Changes:

  • Uses get_backend() for Matplotlib 3.5–3.9.
  • Uses get_backend(auto_select=False) for Matplotlib ≥3.10.
  • Retains the legacy fallback for older versions.
File Description
matplotlib_inline/​backend_inline.py Adds version-aware backend retrieval logic.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sorry, something went wrong.

Uh oh!

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

All reactions
@jwhiss
add tests confirming matplotlib version fix
00f1077

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

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments

Uh oh!

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

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Incompatibility to matplotlib<3.5.2

Uh oh!

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

2 participants

@jwhiss
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.