Skip to content

Commit

Permalink
Merge pull request #14 from opensafely/amended-chart-axis
Browse files Browse the repository at this point in the history
Updated html and pdf reports
  • Loading branch information
brianmackenna authored Mar 30, 2021
2 parents 8eea927 + bb965c7 commit 0213bc1
Show file tree
Hide file tree
Showing 3 changed files with 1,023 additions and 1,028 deletions.
7 changes: 6 additions & 1 deletion lib/report_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,18 +259,23 @@ def make_vaccine_graphs(df, latest_date, savepath, savepath_figure_csvs, suffix=
# legend entries will appear in corresponding order hence be easier to read
dfp = dfp.sort_values(by=dfp.last_valid_index(), axis=1, ascending=False)



# export data to csv
out = dfp.copy()
if savepath_figure_csvs:
out.to_csv(os.path.join(savepath_figure_csvs, f"Cumulative vaccination figures among each eligible group{suffix}.csv"), index=True)

# divide numbers into millions
dfp = dfp/1e6

# plot chart
dfp.plot(legend=True, ds='steps-post')

# set chart labels and other options
plt.xlabel("date", fontweight='bold')
plt.xticks(rotation=90)
plt.ylabel("number of patients vaccinated", fontweight='bold')
plt.ylabel("number of patients vaccinated (millions)", fontweight='bold')
plt.title(f"Cumulative vaccination figures to {latest_date}", fontsize=16)
plt.legend(bbox_to_anchor=(1.04,1), loc="upper left")

Expand Down
Loading

0 comments on commit 0213bc1

Please sign in to comment.