vani battery change
[vaillant-thermostat] / graph.py
1 #!/usr/bin/python
2
3 import numpy as np
4 import matplotlib.pyplot as plt
5 import matplotlib.dates as mdates
6
7 if __name__=="__main__":
8     t, a, b, c, d, e, f, g, temp = np.loadtxt("temp.csv", unpack=True,
9     delimiter=',',
10         converters={
11             #0: mdates.strpdate2num('%Y-%m-%dT%H:%M:%S'),
12             #0: mdates.epoch2num(),
13             #0: lambda s: float(s.strip() or 0),
14         }
15         )
16     print t
17
18     t = mdates.epoch2num(t)
19     print t
20
21     ax = plt.subplot(511)
22     ax.plot_date(t, a, 'b-', linewidth=0.5)
23
24     ax.format_xdata = mdates.DateFormatter("%Y-%m-%d %H:%M:%S")
25     ax.grid(True)
26
27     plt.plot_date(t, b, 'r-', linewidth=0.5)
28
29     plt.subplot(512, sharex = ax)
30     plt.plot_date(t, temp, 'y-', linewidth=0.5)
31
32     plt.subplot(513, sharex = ax)
33     plt.plot_date(t, c, 'c-', linewidth=0.5)
34
35     plt.subplot(514, sharex = ax)
36     plt.plot_date(t, d, 'b-', linewidth=0.5)
37
38     plt.subplot(515, sharex = ax)
39     plt.plot_date(t, e, '-')
40
41     plt.subplot(515, sharex = ax)
42     plt.plot_date(t, f, '-')
43
44     plt.subplot(513, sharex = ax)
45     plt.plot_date(t, g, '-')
46
47
48     plt.show()
49