8000 Backport PR #18026: FIX: Be sure matplotlib.backends is imported befo… · matplotlib/matplotlib@25fe49a · GitHub
[go: up one dir, main page]

Skip to content

Commit 25fe49a

Browse files
timhoffmmeeseeksmachine
authored andcommitted
Backport PR #18026: FIX: Be sure matplotlib.backends is imported before we use it
1 parent be26359 commit 25fe49a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/matplotlib/pyplot.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,8 @@ def switch_backend(newbackend):
227227
The name of the backend to use.
228228
"""
229229
global _backend_mod
230-
230+
# make sure the init is pulled up so we can assign to it later
231+
import matplotlib.backends
231232
close("all")
232233

233234
if newbackend is rcsetup._auto_backend_sentinel:

0 commit comments

Comments
 (0)
0