From d8ebab65f3116206331cb8f0fca50e271544e011 Mon Sep 17 00:00:00 2001 From: fordprefect Date: Fri, 27 Mar 2020 17:00:36 +0100 Subject: [PATCH] increase figure width --- basics.py | 10 +++++----- death_per_case.py | 3 ++- delay_from_china.py | 3 ++- delay_from_usa.py | 3 ++- normalized_to_first_death.py | 3 ++- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/basics.py b/basics.py index cb5cbcd..78414c3 100644 --- a/basics.py +++ b/basics.py @@ -4,11 +4,11 @@ Plot total cases of countries over time on log scale import matplotlib.pyplot as pp def plot(data, countries): - - tcp, tc = pp.subplots() - tdp, td = pp.subplots() - ncp, nc = pp.subplots() - ndp, nd = pp.subplots() + figsize = (10,5) + tcp, tc = pp.subplots(figsize=figsize) + tdp, td = pp.subplots(figsize=figsize) + ncp, nc = pp.subplots(figsize=figsize) + ndp, nd = pp.subplots(figsize=figsize) for loc in data: if loc not in countries: continue diff --git a/death_per_case.py b/death_per_case.py index a580580..c29d1d1 100644 --- a/death_per_case.py +++ b/death_per_case.py @@ -6,13 +6,14 @@ import numpy as np name="death_per_case" def plot(data, countries): + figsize = (10,5) for loc in data: if loc not in countries: continue time, new_cases, new_deaths, total_cases, total_deaths = data[loc] # death/case - pp.figure(name) + pp.figure(name, figsize=figsize) pp.plot(time, np.array(total_deaths)/np.array(total_cases), label=f"{loc}", marker=".") pp.yscale("log") diff --git a/delay_from_china.py b/delay_from_china.py index 7fcb9a9..046cdc9 100644 --- a/delay_from_china.py +++ b/delay_from_china.py @@ -6,12 +6,13 @@ import numpy as np name="delay" def plot(data, countries): + figsize = (10,5) for loc in data: if loc not in countries: continue time, new_cases, new_deaths, total_cases, total_deaths = data[loc] - pp.figure(name) + pp.figure(name, figsize=figsize) day_of_above_hundred_cases = np.argwhere(np.array(total_cases) > 100)[0][0] new_time_axis = np.arange(len(time)) - day_of_above_hundred_cases diff --git a/delay_from_usa.py b/delay_from_usa.py index 1119e21..df355a3 100644 --- a/delay_from_usa.py +++ b/delay_from_usa.py @@ -6,12 +6,13 @@ import numpy as np name="delay" def plot(data, countries): + figsize = (10,5) for loc in data: if loc not in countries: continue time, new_cases, new_deaths, total_cases, total_deaths = data[loc] - pp.figure(name) + pp.figure(name, figsize=figsize) day_of_above_hundred_cases = np.argwhere(np.array(total_cases) > 100)[0][0] new_time_axis = np.arange(len(time)) - day_of_above_hundred_cases diff --git a/normalized_to_first_death.py b/normalized_to_first_death.py index 584e0f2..ab17487 100644 --- a/normalized_to_first_death.py +++ b/normalized_to_first_death.py @@ -6,12 +6,13 @@ import numpy as np name="normalized_to_first_death" def plot(data, countries): + figsize = (10,5) for loc in data: if loc not in countries: continue time, new_cases, new_deaths, total_cases, total_deaths = data[loc] - pp.figure(name) + pp.figure(name, figsize=figsize) day_of_first_death = np.argwhere(np.array(total_deaths) > 0)[0][0] new_time_axis = np.arange(len(time)) - day_of_first_death pp.plot(new_time_axis, np.array(total_cases), label=f"{loc}", marker=".")