Skip to content
Snippets Groups Projects
Commit 65eb7f5d authored by Colm Talbot's avatar Colm Talbot
Browse files

Remove setting of matplotlib backend

parent aee04c79
No related branches found
No related tags found
1 merge request!816Resolve "Don't set the matplotlib backend"
Pipeline #135391 failed
......@@ -971,29 +971,6 @@ command_line_args, command_line_parser = set_up_command_line_arguments()
# Instantiate the default logging
setup_logger(print_version=False, log_level=command_line_args.log_level)
if 'DISPLAY' in os.environ:
logger.debug("DISPLAY={} environment found".format(os.environ['DISPLAY']))
pass
else:
logger.debug('No $DISPLAY environment variable found, so importing \
matplotlib.pyplot with non-interactive "Agg" backend.')
import matplotlib
import matplotlib.pyplot as plt
non_gui_backends = matplotlib.rcsetup.non_interactive_bk
for backend in non_gui_backends:
try:
logger.debug("Trying backend {}".format(backend))
if StrictVersion(matplotlib.__version__) >= StrictVersion("3.1"):
matplotlib.use(backend)
else:
matplotlib.use(backend, warn=False)
plt.switch_backend(backend)
break
except Exception:
print(traceback.format_exc())
class BilbyJsonEncoder(json.JSONEncoder):
def default(self, obj):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment