plot booster vaccinations

This commit is contained in:
fordprefect
2021-09-23 10:22:22 +02:00
parent 4d8f28d9d3
commit a9f72a0b70

View File

@@ -34,6 +34,7 @@ def plot(data, countries, pop, metadata={}, **kwargs):
name = basename+loc name = basename+loc
time, new_cases, new_deaths, total_cases, total_deaths, total_vaccinations, stringency_index, new_vaccinations = data[loc]['time'], data[loc]['new_cases'], data[loc]['new_deaths'], data[loc]['total_cases'], data[loc]['total_deaths'], data[loc]['total_vaccinations'], data[loc]['stringency_index'], data[loc]['new_vaccinations'] time, new_cases, new_deaths, total_cases, total_deaths, total_vaccinations, stringency_index, new_vaccinations = data[loc]['time'], data[loc]['new_cases'], data[loc]['new_deaths'], data[loc]['total_cases'], data[loc]['total_deaths'], data[loc]['total_vaccinations'], data[loc]['stringency_index'], data[loc]['new_vaccinations']
people_fully_vaccinated = data[loc]['people_fully_vaccinated'] people_fully_vaccinated = data[loc]['people_fully_vaccinated']
total_boosters = data[loc]['total_boosters']
fig, ax1 = pp.subplots(num=name, figsize=figsize) fig, ax1 = pp.subplots(num=name, figsize=figsize)
@@ -56,6 +57,7 @@ def plot(data, countries, pop, metadata={}, **kwargs):
ax2.plot(time, np.array(total_vaccinations), label=f"Total vaccination doses", marker="", linestyle="-.", color="crimson") ax2.plot(time, np.array(total_vaccinations), label=f"Total vaccination doses", marker="", linestyle="-.", color="crimson")
ax2.plot(time, np.array(people_fully_vaccinated), label="fully vaccinated", marker="", linestyle="-", color="crimson") ax2.plot(time, np.array(people_fully_vaccinated), label="fully vaccinated", marker="", linestyle="-", color="crimson")
ax2.plot(time, np.array(total_boosters), label="total booster vaccinations", marker="", linestyle="--", color="crimson")
# fix lower bound of plot # fix lower bound of plot
for ax in (ax1, ax2): for ax in (ax1, ax2):