From e0d6508682bd52d3457141dfbb87954f04fe20b4 Mon Sep 17 00:00:00 2001 From: fordprefect Date: Thu, 17 Dec 2020 10:38:30 +0100 Subject: [PATCH] make all plotting modules future proof by accepting kwargs --- all_countries.py | 2 +- basics.py | 2 +- death_per_case.py | 2 +- delay_from_china.py | 2 +- delay_from_usa.py | 2 +- doubling_time.py | 2 +- normalized_to_first_death.py | 2 +- normalized_to_ten_cases.py | 2 +- percent_increase.py | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/all_countries.py b/all_countries.py index e6fc086..0cbebce 100644 --- a/all_countries.py +++ b/all_countries.py @@ -20,7 +20,7 @@ corr = {"Chile": 10000, "Turkey": 100000, } -def plot(data, countries, pop): +def plot(data, countries, pop, **kwargs): figsize = (10,5) for loc in data: diff --git a/basics.py b/basics.py index 4454bb0..1913816 100644 --- a/basics.py +++ b/basics.py @@ -4,7 +4,7 @@ Plot total cases of countries over time on log scale import matplotlib.pyplot as pp import numpy as np -def plot(data, countries, pop): +def plot(data, countries, pop, **kwargs): figsize = (10,5) tcp, tc = pp.subplots(figsize=figsize) # total cases tdp, td = pp.subplots(figsize=figsize) # total deaths diff --git a/death_per_case.py b/death_per_case.py index fe56dc1..9d4b399 100644 --- a/death_per_case.py +++ b/death_per_case.py @@ -5,7 +5,7 @@ import matplotlib.pyplot as pp import numpy as np name="death_per_case" -def plot(data, countries, pop): +def plot(data, countries, pop, **kwargs): figsize = (10,5) for loc in data: if loc not in countries: diff --git a/delay_from_china.py b/delay_from_china.py index 6259949..0f38551 100644 --- a/delay_from_china.py +++ b/delay_from_china.py @@ -5,7 +5,7 @@ import matplotlib.pyplot as pp import numpy as np name="delay" -def plot(data, countries, pop): +def plot(data, countries, pop, **kwargs): figsize = (10,5) # plot delay diff --git a/delay_from_usa.py b/delay_from_usa.py index 3087ed9..6d3e61b 100644 --- a/delay_from_usa.py +++ b/delay_from_usa.py @@ -5,7 +5,7 @@ import matplotlib.pyplot as pp import numpy as np name="delay" -def plot(data, countries, pop): +def plot(data, countries, pop, **kwargs): figsize = (10,5) for loc in data: if loc not in countries: diff --git a/doubling_time.py b/doubling_time.py index b95ad3b..bcc6362 100644 --- a/doubling_time.py +++ b/doubling_time.py @@ -8,7 +8,7 @@ name="doubling_time" def moving_average(x, w): return np.convolve(x, np.ones(w), 'valid') / w -def plot(data, countries, pop): +def plot(data, countries, pop, **kwargs): figsize = (10,5) for loc in data: if loc not in countries: diff --git a/normalized_to_first_death.py b/normalized_to_first_death.py index e8cd2b5..68a497b 100644 --- a/normalized_to_first_death.py +++ b/normalized_to_first_death.py @@ -5,7 +5,7 @@ import matplotlib.pyplot as pp import numpy as np name="normalized_to_first_death" -def plot(data, countries, pop): +def plot(data, countries, pop, **kwargs): figsize = (10,5) for loc in data: if loc not in countries: diff --git a/normalized_to_ten_cases.py b/normalized_to_ten_cases.py index 9c1124b..6f4636d 100644 --- a/normalized_to_ten_cases.py +++ b/normalized_to_ten_cases.py @@ -5,7 +5,7 @@ import matplotlib.pyplot as pp import numpy as np name="normalized_to_100_cases" -def plot(data, countries, pop): +def plot(data, countries, pop, **kwargs): figsize = (10,5) for loc in data: if loc not in countries: diff --git a/percent_increase.py b/percent_increase.py index 79418c4..952477c 100644 --- a/percent_increase.py +++ b/percent_increase.py @@ -8,7 +8,7 @@ name="percent_increase" def moving_average(x, w): return np.convolve(x, np.ones(w), 'valid') / w -def plot(data, countries, pop): +def plot(data, countries, pop, **kwargs): figsize = (10,5) for loc in data: if loc not in countries: