-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplotclimate.py
More file actions
43 lines (32 loc) · 784 Bytes
/
plotclimate.py
File metadata and controls
43 lines (32 loc) · 784 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import matplotlib.pyplot as plt
import gzip
import csv
tempfile=gzip.open('data/temp-20170526.csv.gz','rb')
tempcsv = csv.reader(tempfile,delimiter=',')
print tempcsv.next()
tijd = []
bartemp = []
barpres = []
humidity = []
for row in tempcsv:
tijd.append(int(row[0]))
bartemp.append(float(row[1]))
barpres.append(float(row[2]))
humidity.append(float(row[3]))
fig,ax1 = plt.subplots()
ax1.plot(tijd,bartemp)
ax1.set_xlabel('time[s]')
ax1.set_ylabel('Temperature[C]')
ax2 = ax1.twinx()
ax2.plot(tijd,barpres,'r')
ax2.set_ylabel('Pressure[Pa]')
plt.show()
plt.clf()
fig,ax1 = plt.subplots()
ax1.plot(tijd,bartemp)
ax1.set_xlabel('time[s]')
ax1.set_ylabel('Temperature[C]')
ax2 = ax1.twinx()
ax2.plot(tijd,humidity,'r')
ax2.set_ylabel('Humidity[%]')
plt.show()