Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4c43774

Browse files
authored
Merge pull request #18026 from tacaswell/fix_custom_backend
FIX: Be sure matplotlib.backends is imported before we use it
2 parents 03aebfb + 3399671 commit 4c43774

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)