diff --git a/src/scatters.py b/src/scatters.py index 21ba4b2..12c90cf 100644 --- a/src/scatters.py +++ b/src/scatters.py @@ -6,6 +6,7 @@ import matplotlib.pyplot as plt import sys import numpy as np +from datetime import datetime def scatter(month): df = pd.read_csv('data/Merge/vaccinations-and-deaths-'+month+'.csv', converters={'FIPS' : str}) @@ -16,13 +17,16 @@ def scatter(month): x = df[xlabel] y = df[ylabel] area = df['Census2019_18PlusPop'] / 1e6 #population in millions - + + #To add internation date formation to scatters plot -> animation + IDF_date = datetime.strptime(month, '%m-%d-%Y').strftime('%Y-%m-%d') + fig, ax = plt.subplots() ax.set_xlabel("Percent of Population (+18) Considered Fully Vaccinated") ax.set_ylabel("Deaths per 100K") ax.set_xlim(0,100) ax.set_ylim(0,400) #[KR] changed from 500 limit to 400 limit - ax.set_title("Vaccine Effectiveness Snapshot as of: "+ month) + ax.set_title("Vaccine Effectiveness Snapshot as of: "+ IDF_date) fig.set_size_inches(8,6) ax.spines['top'].set_visible(False) #[MR] Removes top spine ax.spines['right'].set_visible(False) #[MR] Removes right spine