From 5434e0da0af2967a8afe56887179eab6d499a804 Mon Sep 17 00:00:00 2001 From: Ron Wu Date: Fri, 7 Apr 2017 08:06:38 -0400 Subject: [PATCH 1/3] add OS X matplotlib backend --- rl/analytics.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rl/analytics.py b/rl/analytics.py index 63cbc80..5c0c7e4 100644 --- a/rl/analytics.py +++ b/rl/analytics.py @@ -8,8 +8,8 @@ warnings.filterwarnings("ignore", module="matplotlib") -MPL_BACKEND = 'agg' if ( - environ.get('CI') or platform.system() == 'Darwin') else 'TkAgg' +MPL_BACKEND = 'agg' if environ.get('CI') else ('macosx' + if platform.system() == 'Darwin' else 'TkAgg' ) STATS_COLS = [ 'best_session_epi', From f4dcbd6ca72d6b1612be50d3fc3b4df59fd1a8cd Mon Sep 17 00:00:00 2001 From: Ron Wu Date: Sat, 8 Apr 2017 16:24:16 -0400 Subject: [PATCH 2/3] no display interactive plots in parallel mode --- rl/analytics.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/rl/analytics.py b/rl/analytics.py index 5c0c7e4..9d086db 100644 --- a/rl/analytics.py +++ b/rl/analytics.py @@ -8,8 +8,8 @@ warnings.filterwarnings("ignore", module="matplotlib") -MPL_BACKEND = 'agg' if environ.get('CI') else ('macosx' - if platform.system() == 'Darwin' else 'TkAgg' ) +MPL_BACKEND = 'agg' if environ.get('CI') else ( + 'macosx' if platform.system() == 'Darwin' else 'TkAgg') STATS_COLS = [ 'best_session_epi', @@ -40,7 +40,7 @@ def scoped_mpl_import(): import matplotlib matplotlib.rcParams['backend'] = MPL_BACKEND - import matplotlib.pyplot as plt + import matplotlib.pyplot as plt plt.rcParams['toolbar'] = 'None' # mute matplotlib toolbar import seaborn as sns @@ -139,8 +139,9 @@ def plot(self): ax3.relim() ax3.autoscale_view(tight=True, scalex=True, scaley=True) - self.plt.draw() - self.plt.pause(0.01) + if sys_vars['RENDER']: + self.plt.pause(0.01) + self.plt.draw() self.save() import gc gc.collect() From b59762d024a5d262d70fa727b51c19157e827871 Mon Sep 17 00:00:00 2001 From: Ron Wu Date: Sat, 8 Apr 2017 16:36:34 -0400 Subject: [PATCH 3/3] trim whitespace --- rl/analytics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rl/analytics.py b/rl/analytics.py index 9d086db..0a9c261 100644 --- a/rl/analytics.py +++ b/rl/analytics.py @@ -40,7 +40,7 @@ def scoped_mpl_import(): import matplotlib matplotlib.rcParams['backend'] = MPL_BACKEND - import matplotlib.pyplot as plt + import matplotlib.pyplot as plt plt.rcParams['toolbar'] = 'None' # mute matplotlib toolbar import seaborn as sns