This commit is contained in:
zjcOvO 2025-01-25 17:34:14 +08:00
parent cf62c81b2c
commit 50e633ff04
3 changed files with 40 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
result/*

16
data/temperature.csv Normal file
View File

@ -0,0 +1,16 @@
Year,HighTemp,LowTemp,TotalPercip/inch,TotalSnow/inch
2024,82,2,72.1,126.8
2023,85,2,77.0,86.3
2022,85,-8,88.3,65.1
2021,83,-5,76.5,137.0
2020,83,2,77.7,91.5
2019,85,4,60.5,42.9
2018,85,4,55.8,63.8
2017,81,1,69.6,66.8
2016,82,2,64.0,27.2
2015,84,6,85.0,68.2
2014,77,0,68.7,51.1
2013,85,5,73.7,99.6
2012,82,2,63.4,111.5
2011,77,1,66.7,114.1
2010,80,3,53.9,64.5
1 Year HighTemp LowTemp TotalPercip/inch TotalSnow/inch
2 2024 82 2 72.1 126.8
3 2023 85 2 77.0 86.3
4 2022 85 -8 88.3 65.1
5 2021 83 -5 76.5 137.0
6 2020 83 2 77.7 91.5
7 2019 85 4 60.5 42.9
8 2018 85 4 55.8 63.8
9 2017 81 1 69.6 66.8
10 2016 82 2 64.0 27.2
11 2015 84 6 85.0 68.2
12 2014 77 0 68.7 51.1
13 2013 85 5 73.7 99.6
14 2012 82 2 63.4 111.5
15 2011 77 1 66.7 114.1
16 2010 80 3 53.9 64.5

23
simple-plot.py Normal file
View File

@ -0,0 +1,23 @@
import json
import numpy as np
import matplotlib.pyplot as plt
colorList = json.load(open('color/config.json','r'))["color"]
import csv
with open('data/passenger.csv', 'r') as f:
reader = csv.reader(f)
header = next(reader)
data = [row for row in reader]
data = np.array(data).astype(int).T
bar_width = 0.25
for i in range(1,len(data)):
plt.bar(data[0]+(i-2)*bar_width, data[i], label=header[i], color=colorList[i-1], width=bar_width)
plt.legend()
plt.xlabel('Year')
plt.show()