Commit 89ddb3f6 authored by Rousseau Vincent's avatar Rousseau Vincent
Browse files

Pretty legend

parent e6e17d86
......@@ -2,15 +2,16 @@ import csv
import matplotlib.pyplot as plt
from scipy import signal
import numpy as np
from datetime import datetime
with open('sense_hat_data_2019_01_09_12.csv') as f:
with open('data/sense_hat_data_2019_03_01_00.csv') as f:
datas = csv.reader(f)
header = next(datas)
temp = []
time = []
pressure = []
for row in datas:
time.append(float(row[0]))
time.append(datetime.fromtimestamp(float(row[0])))
temp.append(float(row[2]))
pressure.append(float(row[3]))
......@@ -27,10 +28,14 @@ pressure_filtered = signal.savgol_filter(pressure, 53, 3)
fig_temp, ax_temp = plt.subplots()
ax_temp.plot(time,temp)
ax_temp.plot(time,temp_filtered)
ax_temp.set_title('Température')
fig_temp.autofmt_xdate()
fig_pres, ax_pres = plt.subplots()
ax_pres.plot(time, pressure)
ax_pres.plot(time, pressure_filtered)
ax_pres.set_title('Pression')
fig_pres.autofmt_xdate()
plt.show()
......
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