make all plotting modules future proof by accepting kwargs

This commit is contained in:
fordprefect
2020-12-17 10:38:30 +01:00
parent 43cb8b3ec9
commit e0d6508682
9 changed files with 9 additions and 9 deletions

View File

@@ -20,7 +20,7 @@ corr = {"Chile": 10000,
"Turkey": 100000, "Turkey": 100000,
} }
def plot(data, countries, pop): def plot(data, countries, pop, **kwargs):
figsize = (10,5) figsize = (10,5)
for loc in data: for loc in data:

View File

@@ -4,7 +4,7 @@ Plot total cases of countries over time on log scale
import matplotlib.pyplot as pp import matplotlib.pyplot as pp
import numpy as np import numpy as np
def plot(data, countries, pop): def plot(data, countries, pop, **kwargs):
figsize = (10,5) figsize = (10,5)
tcp, tc = pp.subplots(figsize=figsize) # total cases tcp, tc = pp.subplots(figsize=figsize) # total cases
tdp, td = pp.subplots(figsize=figsize) # total deaths tdp, td = pp.subplots(figsize=figsize) # total deaths

View File

@@ -5,7 +5,7 @@ import matplotlib.pyplot as pp
import numpy as np import numpy as np
name="death_per_case" name="death_per_case"
def plot(data, countries, pop): def plot(data, countries, pop, **kwargs):
figsize = (10,5) figsize = (10,5)
for loc in data: for loc in data:
if loc not in countries: if loc not in countries:

View File

@@ -5,7 +5,7 @@ import matplotlib.pyplot as pp
import numpy as np import numpy as np
name="delay" name="delay"
def plot(data, countries, pop): def plot(data, countries, pop, **kwargs):
figsize = (10,5) figsize = (10,5)
# plot delay # plot delay

View File

@@ -5,7 +5,7 @@ import matplotlib.pyplot as pp
import numpy as np import numpy as np
name="delay" name="delay"
def plot(data, countries, pop): def plot(data, countries, pop, **kwargs):
figsize = (10,5) figsize = (10,5)
for loc in data: for loc in data:
if loc not in countries: if loc not in countries:

View File

@@ -8,7 +8,7 @@ name="doubling_time"
def moving_average(x, w): def moving_average(x, w):
return np.convolve(x, np.ones(w), 'valid') / w return np.convolve(x, np.ones(w), 'valid') / w
def plot(data, countries, pop): def plot(data, countries, pop, **kwargs):
figsize = (10,5) figsize = (10,5)
for loc in data: for loc in data:
if loc not in countries: if loc not in countries:

View File

@@ -5,7 +5,7 @@ import matplotlib.pyplot as pp
import numpy as np import numpy as np
name="normalized_to_first_death" name="normalized_to_first_death"
def plot(data, countries, pop): def plot(data, countries, pop, **kwargs):
figsize = (10,5) figsize = (10,5)
for loc in data: for loc in data:
if loc not in countries: if loc not in countries:

View File

@@ -5,7 +5,7 @@ import matplotlib.pyplot as pp
import numpy as np import numpy as np
name="normalized_to_100_cases" name="normalized_to_100_cases"
def plot(data, countries, pop): def plot(data, countries, pop, **kwargs):
figsize = (10,5) figsize = (10,5)
for loc in data: for loc in data:
if loc not in countries: if loc not in countries:

View File

@@ -8,7 +8,7 @@ name="percent_increase"
def moving_average(x, w): def moving_average(x, w):
return np.convolve(x, np.ones(w), 'valid') / w return np.convolve(x, np.ones(w), 'valid') / w
def plot(data, countries, pop): def plot(data, countries, pop, **kwargs):
figsize = (10,5) figsize = (10,5)
for loc in data: for loc in data:
if loc not in countries: if loc not in countries: