Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0d995d4

Browse filesBrowse files
committed
allow selecting the backend by setting the environment variable MPL_BACKEND
1 parent a220e1f commit 0d995d4
Copy full SHA for 0d995d4

File tree

Expand file treeCollapse file tree

1 file changed

+9
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+9
-0
lines changed

‎lib/matplotlib/__init__.py

Copy file name to clipboardExpand all lines: lib/matplotlib/__init__.py
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1373,9 +1373,18 @@ def tk_window_focus():
13731373
if s.startswith(str('-d')) and len(s) > 2: # look for a -d flag
13741374
try:
13751375
use(s[2:])
1376+
break
13761377
except (KeyError, ValueError):
13771378
pass
13781379
# we don't want to assume all -d flags are backends, e.g., -debug
1380+
else:
1381+
# no backend selected from the command line, so we check the environment
1382+
# variable MPL_BACKEND
1383+
if 'MPL_BACKEND' in os.environ:
1384+
try:
1385+
use(os.environ['MPL_BACKEND'])
1386+
except (KeyError, ValueError):
1387+
pass
13791388

13801389
default_test_modules = [
13811390
'matplotlib.tests.test_agg',

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.