add info about current infection state and (5,50,500)/1million inhabitants lines, notes on the html page
This commit is contained in:
@@ -37,9 +37,9 @@ def plot(data, countries, pop):
|
||||
infection_level_indicator = "grey"
|
||||
try:
|
||||
#if False:
|
||||
warn_thresh = 500e-6 * pop[loc]['pop']
|
||||
info_thresh = 50e-6 * pop[loc]['pop']
|
||||
low_thresh = 5e-6 * pop[loc]['pop']
|
||||
warn_thresh = 500e-6 * pop[loc]['pop']/7
|
||||
info_thresh = 50e-6 * pop[loc]['pop']/7
|
||||
low_thresh = 5e-6 * pop[loc]['pop']/7
|
||||
actual_level = np.mean(new_cases[-7:])
|
||||
infection_level_indicator = "green"
|
||||
if actual_level > low_thresh:
|
||||
@@ -50,9 +50,9 @@ def plot(data, countries, pop):
|
||||
infection_level_indicator = "r"
|
||||
bounds = ax1.axis()
|
||||
#if warn_thresh < bounds[3]:
|
||||
ax1.plot([bounds[0], bounds[1]], [warn_thresh]*2, color="red", linestyle=":", label=f"500 new cases per 1M inhabitants: {int(warn_thresh):,}".replace(",", "."))
|
||||
ax1.plot([bounds[0], bounds[1]], [info_thresh]*2, color="peru", linestyle=":", label=f"50 new cases per 1M inhabitants: {int(info_thresh):,}".replace(",", "."))
|
||||
ax1.plot([bounds[0], bounds[1]], [low_thresh]*2, color="gold", linestyle=":", label=f"5 new cases per 1M inhabitants: {int(low_thresh):,}".replace(",", "."))
|
||||
ax1.plot([bounds[0], bounds[1]], [warn_thresh]*2, color="red", linestyle=":", label=f"500 new cases / week / 1M inh.: {int(warn_thresh):,}".replace(",", "."))
|
||||
ax1.plot([bounds[0], bounds[1]], [info_thresh]*2, color="peru", linestyle=":", label=f"50 new cases / week / 1M inh.: {int(info_thresh):,}".replace(",", "."))
|
||||
ax1.plot([bounds[0], bounds[1]], [low_thresh]*2, color="gold", linestyle=":", label=f"5 new cases / week / 1M inh.: {int(low_thresh):,}".replace(",", "."))
|
||||
|
||||
ax1.axis(bounds)
|
||||
except:
|
||||
|
||||
Reference in New Issue
Block a user