Skip to content

Commit d7df790

Browse files
ianthomas23Carreau
authored andcommittedDec 10, 2024
Use improved syntax for matplotlib >= 3.10
1 parent 56ef444 commit d7df790

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed
 

‎matplotlib_inline/backend_inline.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,14 @@ def configure_inline_support(shell, backend):
208208

209209
def _enable_matplotlib_integration():
210210
"""Enable extra IPython matplotlib integration when we are loaded as the matplotlib backend."""
211-
from matplotlib import rcParams
212211
ip = get_ipython()
213-
backend = rcParams._get("backend")
212+
213+
import matplotlib
214+
if matplotlib.__version_info__ >= (3, 10):
215+
backend = matplotlib.get_backend(auto_select=False)
216+
else:
217+
backend = matplotlib.rcParams._get("backend")
218+
214219
if ip and backend in ('inline', 'module://matplotlib_inline.backend_inline'):
215220
from IPython.core.pylabtools import activate_matplotlib
216221
try:

0 commit comments

Comments
 (0)
Failed to load comments.