From: gregor herrmann Date: Sun, 25 Oct 2020 18:46:33 +0000 (+0100) Subject: add temperature plot X-Git-Url: https://git.toastfreeware.priv.at/toast/airingbutler.git/commitdiff_plain/3c9b1e0a571b2f5a109386c7f874426a24e5bff6 add temperature plot --- diff --git a/plot_mhz19.py b/plot_mhz19.py index 0e68605..526c975 100755 --- a/plot_mhz19.py +++ b/plot_mhz19.py @@ -22,6 +22,7 @@ with open(filename) as f: time = [] co2 = [] + temp = [] startdate = date(2020, 10, 22) for row in reader: dt = parsedatetime(row[0], startdate) @@ -30,10 +31,13 @@ with open(filename) as f: dt += timedelta(days=1) time.append(dt) co2.append(int(row[2])) + temp.append(int(row[3])) plt.plot(time, co2, c = 'red') plt.title('CO₂') plt.xlabel('time') plt.ylabel('ppm') plt.tick_params(axis = 'both', which = 'major') + plt.gca().twinx() + plt.plot(time, temp, c = 'blue') plt.show()