AaronWard / covidify

Covidify - corona virus report and dataset generator for python 📈 [no longer being updated]
MIT License
446 stars 113 forks source link

I was missing logscale #32

Closed rdorsch closed 4 years ago

rdorsch commented 4 years ago

Is your feature request related to a problem? Please describe. Since the curves are supposed to be exponential, log scale for the y axis seems to be adequate.

Here is some local modification which worked for me:

rd@h370:~/tmp.nobackup/git/covid-19-analysis$ git diff src/covidify diff --git a/src/covidify/data_visualization.py b/src/covidify/data_visualization.py index 89db5c6..9ceae9c 100644 --- a/src/covidify/data_visualization.py +++ b/src/covidify/data_visualization.py @@ -95,6 +95,7 @@ def create_trend_line(tmp_df, date_col, col, col2, col3, fig_title, country): fig, ax = plt.subplots(figsize=(20,10)) tmp_df.groupby([date_col])[[col, col2, col3]].sum().plot(ax=ax, marker='o') ax.set_title(create_title(fig_title, country))

@@ -102,6 +103,7 @@ def create_bar(tmp_df, col, rgb, country): fig, ax = plt.subplots(figsize=(20,10)) tmp = tmp_df.groupby(['date'])[[col]].sum() ax.set_title(create_title(col, country))

a parameter for pipeline.sh certainly would be better.

I saw the you have a log jupyter notebook, which might do the same, but I did not get it working....

AaronWard commented 4 years ago

Since the curves are supposed to be exponential, log scale for the y axis seems to be adequate.

I am working on that right now coincidentally :) Next release to have a graph which shows the logarithmic growth of the top N countries.

Should have the newest release by tomorrow

AaronWard commented 4 years ago

@rdorsch Log plot in the newest release