diff --git a/drees.py b/drees.py index 06aacac..a71f9a1 100644 --- a/drees.py +++ b/drees.py @@ -386,24 +386,24 @@ def plot_bar_age_percent_by_field( def plot_cumulative_field( np_data: np.ndarray, np_date: np.ndarray, field: Field ) -> None: - fig, _ = get_plot_fig() np_data_vac, np_data_unvac = split_by_vac_status(np_data) - for age_group in AgeGroup: + fig, _ = get_plot_fig() np_cumulate_vac: np.ndarray = np.cumsum( np_data_vac[:, age_group.value, field.value], axis=0 ) np_cumulate_unvac: np.ndarray = np.cumsum( np_data_unvac[:, age_group.value, field.value], axis=0 ) - plt.plot(np_date, np_cumulate_vac, label=f"{age_group.label} Vaccinés") - plt.plot(np_date, np_cumulate_unvac, label=f"{age_group.label} Non vaccinés") + plt.plot(np_date, np_cumulate_vac, label=f"Vaccinés") + plt.plot(np_date, np_cumulate_unvac, label=f"Non vaccinés") - plt.title(f"{field.label} cumulés par âge") - plt.xlabel("date") - save_and_close_fig( - fig, os.path.join(OUTPUT_REPOSITORY, f"cumulative_{field.name.lower()}") - ) + plt.title(f"{age_group.label} - {field.label}") + plt.xlabel("date") + plt.ylabel("nombre") + save_and_close_fig( + fig, os.path.join(OUTPUT_REPOSITORY, f"cumulative_{age_group.name.lower()}_{field.name.lower()}") + ) def plot_fields_by_age_vac( diff --git a/templates/index.template.html b/templates/index.template.html index 9ff363c..1f47e8d 100644 --- a/templates/index.template.html +++ b/templates/index.template.html @@ -35,10 +35,12 @@

Hospitalisations/Soins critiques/Décés cumulés par tranches d'âges et status vaccinal

- {% for field in fields %} -
- -
+ {% for age in ages %} + {% for field in fields %} +
+ +
+ {% endfor %} {% endfor %}