diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4b9b9f7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +result/* \ No newline at end of file diff --git a/data/temperature.csv b/data/temperature.csv new file mode 100644 index 0000000..6891a43 --- /dev/null +++ b/data/temperature.csv @@ -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 \ No newline at end of file diff --git a/simple-plot.py b/simple-plot.py new file mode 100644 index 0000000..4d1d0da --- /dev/null +++ b/simple-plot.py @@ -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() \ No newline at end of file