diff --git a/lpath/plot.py b/lpath/plot.py index 7d2cd65..c775f21 100644 --- a/lpath/plot.py +++ b/lpath/plot.py @@ -151,7 +151,7 @@ def __init__(self, arguments): for pathway in self.pathways: non_zero = pathway[numpy.nonzero(pathway[:, 0])] # Removing padding frames... weights.append(non_zero[-1, -1]) - durations.append(len(non_zero)) + durations.append(len(non_zero) / arguments.stride) target_iter.append(non_zero[-1][0]) iter_num += [frame[0] for frame in non_zero] states.append(pathway[:, 2]) @@ -169,6 +169,7 @@ def __init__(self, arguments): self.num_iter = numpy.asarray(iter_num, dtype=object) self.target_iter = numpy.asarray(target_iter) self.num_clusters = len(path_indices) + self.stride = arguments.stride # weighted_counts = [numpy.sum(self.weights[self.states == i]) for i in range(self.num_clusters)] # self.weighted_counts = numpy.array(weighted_counts, dtype=float) @@ -192,6 +193,9 @@ def __init__(self, arguments): self.show_fig = arguments.dendrogram_show self.ax_idx = 0 + if not self.show_fig: + matplotlib.use('agg') + def plt_config(self, ax_idx=None, separate=None): """ Process matplotlib arguments and append fig/axis objects to class.