From 3c9b1e0a571b2f5a109386c7f874426a24e5bff6 Mon Sep 17 00:00:00 2001 From: gregor herrmann Date: Sun, 25 Oct 2020 19:46:33 +0100 Subject: [PATCH] add temperature plot --- plot_mhz19.py | 4 ++++ 1 file changed, 4 insertions(+) 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() -- 2.39.5