Created
December 7, 2020 21:50
-
-
Save clayh53/4503614b60bde34be61a0ceb686fbacc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fig,ax = plt.subplots(figsize=(12,6)) | |
ax.plot(df.date,df['deathIncrease'].rolling(window=rolling_avg).mean(),color='red',label='14 day moving average new daily infections') | |
sns.set() | |
sns.set_style("whitegrid") | |
ax.plot(df.date, df['predicted_death'].shift(-lag).rolling(window=rolling_avg).mean(), color="blue",linestyle=":",label='14 day moving average predicted new daily deaths') | |
plt.xlim([start_date,end_date]) # moves the prediction forward in time to match the lag as a check | |
leg = ax.legend(loc='center', frameon=False,bbox_to_anchor=(0.5, -0.17)) | |
leg2=ax2.legend(loc='center', frameon=False,bbox_to_anchor=(0.49, -0.22)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment