diff --git a/wsgi.py b/wsgi.py index a70c4e5..6aec640 100644 --- a/wsgi.py +++ b/wsgi.py @@ -122,13 +122,18 @@ def plot( # plt.gcf().autofmt_xdate() - plt.gca().xaxis.set_major_locator(mdates.WeekdayLocator([mdates.TU])) + # use timezone offset to center tick labels + plt.gca().xaxis.set_major_locator( + mdates.WeekdayLocator([mdates.TU], tz="Etc/GMT+12") + ) plt.gca().xaxis.set_minor_locator(mdates.DayLocator()) plt.gca().xaxis.set_major_formatter(mdates.DateFormatter("%a %d.%m.")) - plt.grid(True, which="major", axis="both") + plt.grid(True, which="major", axis="y") plt.grid(True, which="minor", axis="x") + plt.gca().tick_params("x", length=0, which="major") + def val_to_perc(val): return 100 * val / total_target