new data
This commit is contained in:
parent
cf62c81b2c
commit
50e633ff04
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
result/*
|
||||
16
data/temperature.csv
Normal file
16
data/temperature.csv
Normal 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
|
||||
|
23
simple-plot.py
Normal file
23
simple-plot.py
Normal 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()
|
||||
Reference in New Issue
Block a user