24 lines
525 B
Python
24 lines
525 B
Python
"""
|
|
Plot total cases of countries over time on log scale
|
|
"""
|
|
import matplotlib.pyplot as pp
|
|
name="total_cases"
|
|
|
|
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]
|
|
|
|
# total cases
|
|
pp.figure(name)
|
|
pp.plot(time, total_cases, label=f"{loc}")
|
|
|
|
pp.yscale("log")
|
|
pp.xticks(rotation=90)
|
|
pp.legend(frameon=False)
|
|
pp.tight_layout()
|
|
|
|
pp.savefig(name+".png")
|