plottools.py 538 Bytes
Newer Older
1
import matplotlib.pyplot as plt
2
import numpy as np
3
4


5
6
7
8
9
10
11
def plot_in_subplots(figure_id, time_series, plt_linestyle='-'):
    plt.figure(figure_id)
    for ts in time_series:
        plt.subplot(len(time_series), 1, time_series.index(ts) + 1)
        plt.plot(ts.time, ts.values, linestyle=plt_linestyle, label=ts.label)
        plt.gca().autoscale(axis='x', tight=True)
        plt.legend()
12
13


14
15
16
def set_time_series_labels(time_series, time_series_labels):
    for ts in time_series:
        ts.label = time_series_labels[time_series.index(ts)]