feat: Added annotation for start of vaccinations outside vaccination centres
This commit is contained in:
parent
88138f7bfd
commit
6c112de357
1 changed files with 4 additions and 3 deletions
7
plot.py
7
plot.py
|
@ -308,10 +308,10 @@ def save_plot(plot_name):
|
|||
|
||||
print('Created plot {} as {}'.format(plot_name, file_formats))
|
||||
|
||||
def labeled_timeperiod(ax, start, end, text, color='lightgrey'):
|
||||
def labeled_timeperiod(ax, start, end, text, color='lightgrey', y_height = 100):
|
||||
centre = start + (end - start) / 2
|
||||
ax.axvspan(start, end, color=color, alpha=0.5)
|
||||
ax.text(centre, ax.get_ylim()[1], text, bbox={
|
||||
ax.text(centre, ax.get_ylim()[1] * (y_height / 100), text, bbox={
|
||||
'boxstyle': 'square',
|
||||
'fc': color,
|
||||
'ec': 'black'
|
||||
|
@ -320,7 +320,8 @@ def labeled_timeperiod(ax, start, end, text, color='lightgrey'):
|
|||
|
||||
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')
|
||||
labeled_timeperiod(ax, datetime.date(2021, 3, 29), today, 'AZ-Stopp u. 60', 'lightgrey', 96)
|
||||
labeled_timeperiod(ax, datetime.date(2021, 4, 6), today, 'Arztpraxen impfen', 'lightgreen')
|
||||
|
||||
|
||||
def plot_vaccination_bar_graph_total_time():
|
||||
|
|
Loading…
Reference in a new issue