From 3b45bceb9ca77c8ece71d068f6548c4d439cde6c Mon Sep 17 00:00:00 2001 From: Jameson Graef Rollins <jameson.rollins@ligo.org> Date: Wed, 20 May 2020 17:38:22 -0700 Subject: [PATCH] plot: create new dict for trace style This fixes a bug whereby un-styled traces for some reason pick up the previous trace style. --- gwinc/plot.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gwinc/plot.py b/gwinc/plot.py index 4a0c38d..3f296ab 100644 --- a/gwinc/plot.py +++ b/gwinc/plot.py @@ -27,9 +27,11 @@ def plot_noise( for name, trace in traces.items(): if isinstance(trace, Mapping): trace = trace['Total'] + try: - data, style = trace - except: + data = trace[0] + style = dict(**trace[1]) + except TypeError: data = trace style = {} # assuming all data is PSD @@ -48,6 +50,7 @@ def plot_noise( style['lw'] = style['linewidth'] elif 'lw' not in style: style['lw'] = 3 + ax.loglog(freq, data, **style) ax.grid( -- GitLab