This commit is contained in:
fordprefect
2020-03-19 17:09:47 +01:00
parent ae83263ccb
commit 4d9108f35b
4 changed files with 131 additions and 68 deletions

23
death_per_case.py Normal file
View File

@@ -0,0 +1,23 @@
"""
Plot total deaths per total cases of countries over time on log scale
"""
import matplotlib.pyplot as pp
import numpy as np
name="death_per_case"
def plot(data, countries):
for loc in data:
if loc not in countries:
continue
time, new_cases, new_deaths, total_cases, total_deaths = data[loc]
# death/case
pp.figure(name)
pp.plot(time, np.array(total_deaths)/np.array(total_cases), label=f"{loc}")
pp.yscale("log")
pp.xticks(rotation=90)
pp.legend(frameon=False)
pp.tight_layout()
pp.savefig(name+".png")