Skip to content
Snippets Groups Projects
Commit dd7a6ed6 authored by David Keitel's avatar David Keitel
Browse files

workaround for matplotlib on X-less remote logins

 -first check $DISPLAY environment variable
 -then use non-interactive "AGG" backend if necessary
parent 720f57fa
No related branches found
No related tags found
No related merge requests found
...@@ -6,7 +6,17 @@ import glob ...@@ -6,7 +6,17 @@ import glob
import subprocess import subprocess
import numpy as np import numpy as np
# workaround for matplotlib on X-less remote logins
if os.environ.has_key('DISPLAY'):
import matplotlib.pyplot as plt
else:
logging.info('No $DISPLAY environment variable found, \
so importing matplotlib.pyplot with non-interactive "Agg" backend.')
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
import scipy.special import scipy.special
import scipy.optimize import scipy.optimize
import lal import lal
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment