From: gregor herrmann Date: Sun, 25 Oct 2020 01:22:41 +0000 (+0100) Subject: add plot_mhz19.py X-Git-Url: https://git.toastfreeware.priv.at/toast/airingbutler.git/commitdiff_plain/965b869664a58ba0ee86250d06115311f1b712b5?hp=dd8d9dcb9ab940752f005b4cc5449d270a02c83a add plot_mhz19.py trivial sketch to plot collected test data. copied from somewhere, so yeah, the x axis has room for improvement. --- diff --git a/plot_mhz19.py b/plot_mhz19.py new file mode 100755 index 0000000..fc3976a --- /dev/null +++ b/plot_mhz19.py @@ -0,0 +1,29 @@ +#!/usr/bin/python3 + +import csv +from matplotlib import pyplot as plt + +filename = 'log.csv' +''' +Time,TS,CO2,Temp +21:02:02,0,661,24 +21:02:08,5021,657,24 + +''' +with open(filename) as f: + reader = csv.reader(f) + headers = next(reader) + + time = [] + co2 = [] + for row in reader: + time.append(row[0]) + co2.append(int(row[2])) + + fig = plt.figure(dpi = 128, figsize = (10,6)) + plt.plot(co2, c = 'red') + plt.title('CO₂', fontsize = 24) + plt.xlabel('',fontsize = 16) + plt.ylabel('ppm', fontsize = 16) + plt.tick_params(axis = 'both', which = 'major', labelsize = 16) + plt.show()