Skip to content

Instantly share code, notes, and snippets.

@mjam03
Created February 22, 2021 11:10
Show Gist options
  • Save mjam03/71dd38c44deecabf930d56ba2b5ad867 to your computer and use it in GitHub Desktop.
Save mjam03/71dd38c44deecabf930d56ba2b5ad867 to your computer and use it in GitHub Desktop.
test_7
fig, ax = plt.subplots(nrows=1, ncols=2, figsize=(24,7))
df_ew_ed[['week_end', 'Deaths', 'RespiratoryDeaths']].set_index('week_end').plot(ax=ax[0]);
ax[0].set_title('Weekly Respiratory and Total Death Count in England & Wales', fontdict={'fontsize': 14})
ax[0].set_xlabel('Time');
ax[0].set_ylabel('Death Count');
ax[0].set_yticklabels(['{:,}'.format(int(x)) for x in ax[0].get_yticks().tolist()]);
pd.DataFrame({'Respiratory Deaths as % of Total Deaths': df_ew_ed['RespiratoryDeaths'].divide(df_ew_ed['Deaths'])}).set_index(df_ew_ed['week_end']).plot(ax=ax[1]);
ax[1].set_title('Respiratory Deaths as % of Total Deaths', fontdict={'fontsize': 14})
ax[1].set_xlabel('Time');
ax[1].set_ylabel('% Deaths');
ax[1].set_yticklabels(['{:,}'.format(int(x*100))+'%' for x in ax[1].get_yticks().tolist()]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment