fix new cases axis upper bounds for spikey data, improved landing page comment

This commit is contained in:
fordprefect
2020-08-04 17:32:09 +02:00
parent 3ce5fde5bd
commit 1bae7d02fc
2 changed files with 14 additions and 0 deletions

View File

@@ -8,6 +8,15 @@ import time as time_module
import pickle
basename="all_"
# manual y adjustments for new cases
corr = {"Chile": 10000,
"China": 4000,
"Ecuador": 2500,
"Kazakhstan": 5000,
"Kyrgyztan": 2200,
"Peru": 10000,
}
def plot(data, countries, pop):
figsize = (10,5)
@@ -30,6 +39,9 @@ def plot(data, countries, pop):
# fix lower bound of plot
for ax in (ax1, ax2):
axis = ax.axis()
if ax is ax1: # adjust left (new cases) axes upper boundary for given countries
if loc in corr:
axis = [axis[0], axis[1], axis[2], corr[loc]]
ax.axis([axis[0], axis[1], -1, axis[3]])
# if we know population: plot 500 new cases / 1million inhabitants as a rough measure for comparison