diff --git a/all_countries.py b/all_countries.py new file mode 100644 index 0000000..e153f5f --- /dev/null +++ b/all_countries.py @@ -0,0 +1,31 @@ +""" +Plot overview plot for each country separately +""" +import matplotlib.pyplot as pp +import numpy as np +basename="all_" + +def plot(data, countries): + figsize = (10,5) + for loc in data: + name = basename+loc + time, new_cases, new_deaths, total_cases, total_deaths = data[loc] + + fig, ax1 = pp.subplots(num=name, figsize=figsize) + + ax1.plot(time, new_cases, label="raw new cases", color="grey", linestyle="-") + ax1.plot(time[3:-3], np.convolve(new_cases, np.ones((7,))/7, mode="valid"), label="new cases 7day mean", color="orange", linestyle="-", linewidth=2) + + ax2 = ax1.twinx() + ax2.plot(time, total_cases, label=f"Total cases", marker="", linestyle="--", color="blue") + + #ax1.xticks(rotation=45) + #ax1.set_xlabel("date") + ax1.set_ylabel("new cases") + ax2.set_ylabel("total cases") + fig.legend(frameon=False, loc="upper left", bbox_to_anchor=(0,1), bbox_transform=ax1.transAxes) + pp.title(loc) + fig.tight_layout() + + pp.savefig("ac_"+name+".png") + pp.close(fig) diff --git a/index.en.html b/index.en.html deleted file mode 100644 index 5a993e9..0000000 --- a/index.en.html +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - - -
-

Visualizations for Corona2020

-
-
- -

Idea

-Everywhere you can see beautiful graphs, but none of them are logarithmic, to better estimate the developement. -So, I made some automatically daily updated plots and put them here. - -Not beautiful, but hopefully informing. - -Data sourced from here and is gereneated from the WHO reports. - -
-Basics -
-total cases - -
- -
-new cases - -
- -
-total deaths - -
- -
-new deaths - -
-
-
- -
-percentual increase -New cases relative to total cases, with moving average of 3 days. - -
- -
-doubling time -Doubling time with moving average of 3 days. - -
- -
-Deaths per cases - -
- -
-Absolute cases timeshifted to day of first reported death -Warning: data might be incomplete and not start with zero death (e.g. China). -
- -
- -
-Absolute cases timeshifted to day of reported infections exceeding 100 -Timeshift to 100 cases, when in most countries the exponential growth fully set in. -
- -
- -
-Delay from China in days -Delay from case numbers seen in China counted in days -
- -
- -
-Delay from USA in days -Delay from case numbers seen in USA counted in days -
- -
- - -
-
-Ein Infoservice von dukun.de; Suggestions by Mail; Proudly made with Python, Matplotlib, Numpy -
- -