1
0
Fork 0

feat: Added annotation for AstraZeneca stop

This commit is contained in:
Benedikt Bastin 2021-03-23 11:49:14 +01:00
parent 0b2b13b07b
commit 5b8d0499c5
1 changed files with 18 additions and 0 deletions

18
plot.py
View File

@ -359,6 +359,8 @@ def plot_vaccination_bar_graph_total_time_by_week():
bar1 = ax.bar(w, f, label='Wöchentliche Erstimpfungen', color='blue', width=6.8)
bar2 = ax.bar(w, s, label='Wöchentliche Zweitimpfungen', color='lightblue', width=6.8, bottom=f)
i = 0
for r1, r2 in zip(bar1, bar2):
x = r1.get_x() + r1.get_width() / 2.0
@ -375,6 +377,22 @@ def plot_vaccination_bar_graph_total_time_by_week():
plt.text(x, hg * 1000, f'{hg:5n} k'.replace('.', ''), ha='center', va='bottom')
if i == 12:
# Woche der AstraZeneca-Aussetzung
plt.annotate('AstraZeneca-Aussetzung', (x, hg * 1000 + 50000),
xytext=(x, ax.get_ylim()[1]),
arrowprops={
'arrowstyle': '->'
},
bbox={
'boxstyle': 'square',
'fc': 'white',
'ec': 'black'
})
i = i + 1
ax.legend(loc='upper left')
ax.get_xaxis().set_major_formatter(DateFormatter('%Y-w%W'))
ax.get_xaxis().set_major_locator(WeekdayLocator(3, 2))