From 17220c07d9aab281683340629399ac0ca3cb09e3 Mon Sep 17 00:00:00 2001 From: Andrew Hundt Date: Sun, 1 Jan 2017 21:25:46 -0500 Subject: [PATCH] matplotlib needs Qt5Agg backend in Ubuntu 16.04 --- python/gps/gps_main.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/python/gps/gps_main.py b/python/gps/gps_main.py index d3a0ea883..f391186a8 100755 --- a/python/gps/gps_main.py +++ b/python/gps/gps_main.py @@ -1,7 +1,20 @@ """ This file defines the main object that runs experiments. """ import matplotlib as mpl -mpl.use('Qt4Agg') +qt_found=False +try: + import PyQt4 + mpl.use('Qt4Agg') + qt_found = True +except ImportError: + qt_found = False +if qt_found == False: + try: + import PyQt5 + mpl.use('Qt5Agg') + qt_found = True + except ImportError: + qt_found = False import logging import imp