1
0
Fork 0

Compare commits

...

2 Commits

Author SHA1 Message Date
Benedikt Bastin b02d05a1d5 feat: New plot for vaccination rates of last three weeks 2021-04-20 15:42:07 +02:00
Benedikt Bastin f2c767d957 fix: Changed annotation for AstraZeneca stop below 60 2021-04-20 15:41:49 +02:00
1 changed files with 51 additions and 10 deletions

61
plot.py
View File

@ -235,7 +235,7 @@ def labeled_timeperiod(ax, start, end, text, color='lightgrey', y_height = 100):
def add_annotations(ax):
labeled_timeperiod(ax, datetime.date(2021, 3, 15), datetime.date(2021, 3, 19), 'AZ-Stopp', 'silver')
labeled_timeperiod(ax, datetime.date(2021, 3, 29), today, 'AZ-Stopp u. 60', 'lightgrey', 96)
labeled_timeperiod(ax, datetime.date(2021, 3, 29), datetime.date(2021, 4, 6), 'AZ-Stopp u. 60', 'lightgrey', 96)
labeled_timeperiod(ax, datetime.date(2021, 4, 6), today, 'Arztpraxen impfen', 'lightgreen')
@ -276,6 +276,43 @@ def plot_vaccination_bar_graph_total_time():
plot_vaccination_bar_graph_total_time()
def plot_vaccination_bar_graph_last_three_weeks():
plot_name = 'vaccination_bar_graph_last_three_weeks'
if not check_recreate_plot(plot_name):
return
fig, ax = plt.subplots(1)
plt.title(
'Tägliche Impfrate der letzten drei Wochen (Erst- und Zweitimpfung übereinander)\n'
'Datenquelle: RKI, Stand: {}. Erstellung: {}, Ersteller: Benedikt Bastin, Lizenz: CC BY-SA 4.0\n'.format(
print_stand, print_today
)
)
ax.grid()
ax.bar(dates, data_first_vaccination['daily'], label='Tägliche Erstimpfungen', color='blue')
ax.bar(dates, data_second_vaccination['daily'], label='Tägliche Zweitimpfungen', color='lightblue', bottom=data_first_vaccination['daily'])
ax.set_xlim([today - datetime.timedelta(22), today])
ax.legend(loc='upper left')
ax.get_yaxis().get_major_formatter().set_scientific(False)
ax.set_xlabel('Datum')
ax.set_ylabel('Tägliche Impfungen')
add_annotations(ax)
save_plot(plot_name)
plt.close()
plot_vaccination_bar_graph_last_three_weeks()
def plot_vaccination_bar_graph_total_time_by_week():
plot_name = 'vaccination_bar_graph_total_time_by_week'
@ -801,42 +838,46 @@ def render_dashboard():
'caption': 'Tägliche Impfrate (Erst- und Zweitimpfung übereinander)'
},{
'index': 2,
'filename': 'vaccination_bar_graph_last_three_weeks',
'caption': 'Tägliche Impfrate der letzten drei Wochen (Erst- und Zweitimpfung übereinander)'
},{
'index': 3,
'filename': 'vaccination_bar_graph_total_time_by_week',
'caption': 'Wöchentliche Impfrate (Erst- und Zweitimpfung übereinander)'
},{
'index': 3,
'index': 4,
'filename': 'vaccination_bar_graph_total_time_two_bars',
'caption': 'Tägliche Impfrate (Erst- und Zweitimpfung nebeneinander)'
},{
'index': 4,
'index': 5,
'filename': 'vaccination_bar_graph_compare_both_vaccinations',
'caption': 'Tägliche Impfrate (Erst- und Zweitimpfung nebeneinander)'
},{
'index': 5,
'index': 6,
'filename': 'cumulative_two_vaccinations',
'caption': 'Kumulative Impfrate (Erst- und Zweitimpfung)'
},{
'index': 6,
'index': 7,
'filename': 'cumulative_two_vaccinations_percentage',
'caption': 'Kumulative Impfrate (Erst- und Zweitimpfung) in Prozent der Bevölkerung Deutschlands'
},{
'index': 7,
'index': 8,
'filename': 'people_between_first_and_second',
'caption': 'Anzahl der Personen zwischen Erst- und Zweitimpfung, also Personen, die die erste Impfung erhalten haben, die zweite aber noch nicht'
},{
'index': 8,
'index': 9,
'filename': 'vaccination_rate',
'caption': 'Tägliche Impfrate sowie durchschnittliche Impfrate'
},{
'index': 9,
'index': 10,
'filename': 'vaccination_done_days',
'caption': 'Lineare Extrapolation bis 70 % der Bevölkerung anhand der Erstimpfungen der durchschnittlichen Impfrate (Anzahl Tage, Gesamt und 7 Tage)'
},{
'index': 10,
'index': 11,
'filename': 'vaccination_done_weeks',
'caption': 'Lineare Extrapolation bis 70 % der Bevölkerung anhand der Erstimpfungen der durchschnittlichen Impfrate (Anzahl Wochen, Gesamt und 7 Tage)'
},{
'index': 11,
'index': 12,
'filename': 'vaccination_done_dates',
'caption': 'Lineare Extrapolation bis 70 % der Bevölkerung anhand der Erstimpfungen der durchschnittlichen Impfrate (Datum, Gesamt und 7 Tage)'
}