Commit 114a6a8a authored by Mario Hock's avatar Mario Hock

common_base_time, optional color parameter

parent b9cb37f2
......@@ -17,6 +17,23 @@ import csv
import os
def get_common_base_time(cnl_files):
base_times = list()
for file in cnl_files:
if ( type(file) == str ):
cnl_file = CNLParser(file)
else:
cnl_file = file
base_times.append( cnl_file.get_machine_readable_date() )
common_base_time = min( base_times )
return common_base_time
def human_readable_from_seconds(seconds):
if ( seconds == 0 ):
return "0"
......
......@@ -102,11 +102,15 @@ def get_min_max_x(cnl_file):
def plot(ax, x_values, cols, active_cols, col_labels, alpha, **kwargs):
def plot(ax, x_values, cols, active_cols, col_labels, alpha, color=None, **kwargs):
#use_ema = kwargs.get("use_ema")
ema_only = kwargs.get("ema_only")
smooth = kwargs.get("smooth")
plot_kws = dict()
if ( color ):
plot_kws["color"] = color
for col_name, col_label in zip(active_cols, col_labels):
data = cols[col_name]
if ( len(x_values) == len(data)*2 ):
......@@ -114,11 +118,11 @@ def plot(ax, x_values, cols, active_cols, col_labels, alpha, **kwargs):
# * plot *
if ( not ema_only ):
ax.plot(x_values , data, label=col_label, alpha=alpha)
ax.plot(x_values , data, label=col_label, alpha=alpha, **plot_kws)
## plot ema
if ( ema_only and smooth ):
ax.plot(x_values , calc_ema(data, smooth), label=col_label)
ax.plot(x_values , calc_ema(data, smooth), label=col_label, **plot_kws)
def plot_net(ax, cnl_file, args, layout):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment