Skip to content

Commit

Permalink
Merge from 2.x: PR #489
Browse files Browse the repository at this point in the history
  • Loading branch information
ccordoba12 committed May 22, 2024
2 parents 09c370a + 3ca2930 commit 43d8cfa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion spyder_kernels/console/kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ def get_matplotlib_backend(self):
"""Get current matplotlib backend."""
try:
import matplotlib
return MPL_BACKENDS_TO_SPYDER[matplotlib.get_backend()]
return MPL_BACKENDS_TO_SPYDER[matplotlib.get_backend().lower()]
except Exception:
return None

Expand Down
11 changes: 6 additions & 5 deletions spyder_kernels/utils/mpl.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@

# Mapping of matlotlib backends options to Spyder
MPL_BACKENDS_TO_SPYDER = {
inline_backend: "inline",
'Qt5Agg': 'qt',
'QtAgg': 'qt', # For Matplotlib 3.5+
'TkAgg': 'tk',
'MacOSX': 'osx',
'inline': 'inline', # For Matplotlib >=3.9
inline_backend: "inline", # For Matplotlib <3.9
'qt5agg': 'qt',
'qtagg': 'qt', # For Matplotlib 3.5+
'tkagg': 'tk',
'macosx': 'osx',
}


Expand Down

0 comments on commit 43d8cfa

Please sign in to comment.