From d205625ef40396c5231af76881e108903128a54c Mon Sep 17 00:00:00 2001 From: Felix Blanke Date: Thu, 28 Sep 2023 20:38:48 +0200 Subject: [PATCH] Update plot --- wsgi.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/wsgi.py b/wsgi.py index 904537e..eb54f80 100644 --- a/wsgi.py +++ b/wsgi.py @@ -113,7 +113,10 @@ def plot( fix_lims: bool = True, max_shading_date=None, ) -> str: - fig = plt.figure(dpi=300, figsize=(7, 5)) + fig = plt.figure(dpi=300, figsize=(8.5, 5)) + + target_time = pd.Timestamp("2023-10-01") + plt.axvline(x=target_time, color="tab:green", linestyle=":") if fix_lims: for total_target in total_targets: @@ -202,14 +205,14 @@ def plot( # fill weekends if max_shading_date is None: - max_shading_date = df.index.max() + datetime.timedelta(days=3) + max_shading_date = df.index.max() + datetime.timedelta(days=4) days = pd.date_range(start="2023-08-14", end=max_shading_date) for idx, day in enumerate(days[:-1]): if day.weekday() >= 5: plt.gca().axvspan(days[idx], days[idx + 1], alpha=0.2, color="gray") # reset xlim - plt.xlim(xlim) + plt.xlim((xlim[0], pd.Timestamp("2023-10-02"))) plt.tight_layout()