diff --git a/plot.py b/plot.py index 9512731..5ef08d1 100644 --- a/plot.py +++ b/plot.py @@ -20,6 +20,7 @@ from functools import reduce from matplotlib.dates import date2num, DateFormatter, WeekdayLocator import matplotlib.dates as mdates import matplotlib.ticker as mtick +from matplotlib.patches import Rectangle from isoweek import Week @@ -745,13 +746,14 @@ def plot_vaccination_done_days(): ax.grid(True) + d = datetime.date(2021, 3, 1) + ax.add_patch(Rectangle((d, 0), today - d, 52 * 7, edgecolor='darkgrey', lw=3, fill=False, label='Detailansicht (s.u.)')) ax.legend(loc='upper right') ax.get_yaxis().get_major_formatter().set_scientific(False) ax.set_xlabel('Datum') ax.set_ylabel('Tage, bis 70 % erreicht sind') - add_annotations(ax) save_plot(plot_name) @@ -779,7 +781,7 @@ def plot_vaccination_done_weeks(): weeks_remaining_daily = np.ceil((einwohner_deutschland * 0.7 - d['cumulative']) / (d['mean_vaccination_rates_daily'])) / 7 weeks_remaining_rolling = np.ceil((einwohner_deutschland * 0.7 - d['cumulative']) / (d['vaccination_rates_daily_rolling_average'])) / 7 - ax.set_xlim(datetime.datetime(2021, 3, 1), today) + ax.set_xlim(datetime.date(2021, 3, 1), today) ax.set_ylim(0, 52) ax.axhline(days_until_target / 7, label='Impfziel Ende Sommer')