From cb12b23dc0f01f9943081ec66e5378f78fdff6b1 Mon Sep 17 00:00:00 2001 From: Maximilian Schmidt <max.schmidt@fz-juelich.de> Date: Tue, 5 Jun 2018 13:45:15 +0900 Subject: [PATCH] Remove dependence of seaborn from SchueckerSchmidt2017 scripts --- figures/SchueckerSchmidt2017/stabilization.py | 5 ++--- figures/SchueckerSchmidt2017/utils.py | 7 ++----- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/figures/SchueckerSchmidt2017/stabilization.py b/figures/SchueckerSchmidt2017/stabilization.py index d9cb70e..1e8047a 100644 --- a/figures/SchueckerSchmidt2017/stabilization.py +++ b/figures/SchueckerSchmidt2017/stabilization.py @@ -5,8 +5,6 @@ from multiarea_model import MultiAreaModel from multiarea_model.multiarea_helpers import create_vector_mask from multiarea_model.stabilize import stabilize import utils -import seaborn as sns -cp = sns.color_palette() """ Initialization @@ -68,7 +66,8 @@ for iteration in [1, 2, 3, 4, 5]: # Scan parameter space to find a good approximation of the # critical parameter value where the model crosses the # separatrix for the initial condition of zero rates - if iteration < 5: # For iteration 5, we just analyze the behavior without performing the stabilization + if iteration < 5: + # For iteration 5, we just analyze the behavior without performing the stabilization data[iteration] = utils.compute_iteration(7, fac_nu_ext_5E_list, theory_params, M_base, threads=THREADS) else: diff --git a/figures/SchueckerSchmidt2017/utils.py b/figures/SchueckerSchmidt2017/utils.py index 92f0933..506fc4f 100644 --- a/figures/SchueckerSchmidt2017/utils.py +++ b/figures/SchueckerSchmidt2017/utils.py @@ -53,15 +53,12 @@ def velocity_peaks(time, result, threshold=0.05): def plot_iteration(results, theory_params, threshold=0.05, full=True): - import seaborn as sns - traj = np.mean(results, axis=1) if full: ind = list(range(0, len(traj))) else: i = np.argmax(np.diff(traj[:, -1])) ind = [i, i+1] - cp = sns.color_palette(n_colors=len(ind)) time = np.arange(0., theory_params['T'], theory_params['dt']) fig = pl.figure() @@ -76,13 +73,13 @@ def plot_iteration(results, theory_params, threshold=0.05, full=True): ax = fig.add_subplot(122) for n, i in enumerate(ind): d_nu, minima = velocity_peaks(time, results[i], threshold=threshold) - ax.plot(time[:-1], d_nu, color=cp[n]) + ax.plot(time[:-1], d_nu) if not full: ax.vlines(time[minima], 1e-6, 1e0, linestyles='dashed', - color=cp[n]) + color='k') ax.set_yscale('Log') pl.show() -- GitLab