increase figure width
This commit is contained in:
10
basics.py
10
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
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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=".")
|
||||
|
||||
Reference in New Issue
Block a user