diff --git a/08-31-2022.png b/08-31-2022.png new file mode 100644 index 0000000..af9adee Binary files /dev/null and b/08-31-2022.png differ diff --git a/README.md b/README.md index 392499e..30acea8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # Exploring COVID-19 Vaccine Effectiveness ## National View ![](img/animation.gif) + +adding some tex - MB ## County View ![](img/comparison.png) diff --git a/img/05-31-2021.png b/img/05-31-2021.png index 9645cf8..f13ba65 100644 Binary files a/img/05-31-2021.png and b/img/05-31-2021.png differ diff --git a/img/06-30-2021.png b/img/06-30-2021.png index dbd31ea..73941c6 100644 Binary files a/img/06-30-2021.png and b/img/06-30-2021.png differ diff --git a/img/07-31-2021.png b/img/07-31-2021.png index 16fb68f..9a9ba59 100644 Binary files a/img/07-31-2021.png and b/img/07-31-2021.png differ diff --git a/img/08-31-2021.png b/img/08-31-2021.png index 74c4dca..1585bcb 100644 Binary files a/img/08-31-2021.png and b/img/08-31-2021.png differ diff --git a/img/08-31-2022.png b/img/08-31-2022.png new file mode 100644 index 0000000..af9adee Binary files /dev/null and b/img/08-31-2022.png differ diff --git a/img/09-30-2021.png b/img/09-30-2021.png index d9a5097..9b81ddc 100644 Binary files a/img/09-30-2021.png and b/img/09-30-2021.png differ diff --git a/img/10-31-2021.png b/img/10-31-2021.png index 8d057e3..8ca5399 100644 Binary files a/img/10-31-2021.png and b/img/10-31-2021.png differ diff --git a/img/11-30-2021.png b/img/11-30-2021.png index a34033e..406d3c5 100644 Binary files a/img/11-30-2021.png and b/img/11-30-2021.png differ diff --git a/src/animation.py b/src/animation.py index ed200b9..590b26f 100644 --- a/src/animation.py +++ b/src/animation.py @@ -6,7 +6,7 @@ import imageio as iio import os - +import time # added by Max Burtis for hw02 def create_gif(filename_save): """This function creates a gif animation from a folder of png images Parameters: @@ -15,8 +15,11 @@ def create_gif(filename_save): #makes a list of im NumPy arrays based on a list of .png images (read from folder) images = list() + timestamps=[image for image in os.listdir('img') if image.endswith('png')] #added by Max Burtis for hw02 + timestamps.sort(key=lambda x: time.mktime(time.strptime(x[:-4],"%m-%d-%Y"))) #added by Max Burtis for hw02 + #this part looks at the img directory and reads in all the files that end with .png (only going to bring in those) - for filename in sorted(os.listdir('img')): + for filename in timestamps: #added by Max Burtis for hw02 if filename[-4:] == '.png' and not filename == 'comparison.png': f = os.path.join('img',filename) im = iio.imread(f) diff --git a/src/scatters.py b/src/scatters.py index ca8618a..95d08a5 100644 --- a/src/scatters.py +++ b/src/scatters.py @@ -17,6 +17,8 @@ def scatter(month): y = df[ylabel] area = df['Census2019_18PlusPop'] / 1e6 #population in millions + + fig, ax = plt.subplots() ax.set_xlabel("Percent of Population (+18) Considered Fully Vaccinated") ax.set_ylabel("Deaths per 100K") @@ -53,7 +55,7 @@ def scatter(month): for area_scl in [0.5, 2, 4]: ax.scatter([], [], s = plot_scl*area_scl, c = "gray", alpha = 0.5, label = str(area_scl) + 'M') ax.legend(loc = (1.05, 0.3), title="Population (Millions)", labelspacing = 1.5, borderpad = 1) - + plt.text(30, 200, month, fontsize = 30).set_alpha(.4) plt.tight_layout() plt.savefig('img/'+month+'.png')