Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion matplotlib_inline/backend_inline.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,11 @@ def _enable_matplotlib_integration():

import matplotlib

if matplotlib.__version_info__ >= (3, 10):
version = matplotlib.__version_info__
if version >= (3, 10):
backend = matplotlib.get_backend(auto_select=False)
elif version >= (3, 5):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is not correct. get_backend() triggers backend resolution, which is explicitly not wanted - see #38.

Also, rcParams._get() was introduced in in matplotlib 3.7, see here.

The correct way would be

    elif version >= (3, 7):
        backend = matplotlib.rcParams._get("backend")
    else:
        backend = dict.__getitem__(matplotlib.rcParams, "backend")

backend = matplotlib.get_backend()
else:
backend = matplotlib.rcParams._get("backend")

Expand Down