From 624f54ae8ccdc3fa0f3cd2d9ad190e3ff9a36db1 Mon Sep 17 00:00:00 2001 From: Clemens Klug Date: Thu, 9 May 2019 10:37:56 +0200 Subject: [PATCH] add more dates --- plot.py | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/plot.py b/plot.py index 9bf5c86..c50ebc5 100644 --- a/plot.py +++ b/plot.py @@ -6,9 +6,10 @@ from matplotlib import pyplot as plt # ("year-month", studentenwerksbeitrag, semesterticket, semestergebühren), raw_data = [ #("", , , ), -("2011-08", 65, 0, 0), # ck ws1112, gesamtsumme -("2012-01", 73, 0, 0), # ck ss12, gesamtsumme -("2012-07", 73, 0, 0), # ck ws1213, gesamtsumme +("2011-08", 65, 0, 450), # ck ws1112, gesamtsumme +#("2012-01", 73, 0, 450), # ck ss12, gesamtsumme +("2012-02", 42, 31, 450), # ckre ss12, 523/450/31 +("2012-07", 42, 31, 450), #("2012-07", 73, 0, 0), # ck ws1213, gesamtsumme ("2013-01", 42, 31, 450), ("2013-02", 42, 31, 450), #ck ss13 ("2013-07", 42, 31, 0), @@ -30,7 +31,10 @@ raw_data = [ ("2017-03", 50, 38, 0), #ck ss17 ("2017-06", 50, 38, 0), #ck ws1718 ("2017-07", 50, 38, 0), -("2018-02", 90.2, 0, 0), #ck ss18, gesamtsumme +#("2018-02", 90.2, 0, 0), #ck ss18, gesamtsumme +("2018-03", 50, 40.2, 0), # ckre ss18 +("2018-07", 50, 40.2, 0), # ckre ws18 +("2019-01", 50, 40.4, 0), # ckre ss19 ("2019-05", 60, 40.4, 0), ] @@ -44,13 +48,16 @@ for raw_dt, studw, ticket, sem in raw_data: # plt.plot_date(date, (studw+ticket), xdate=True) dates, studw, tickets, sem, day_diff = zip(*data) -#plt.plot_date(day_diff, studw, xdate=True, linestyle="solid",label="studentenwerksbeitrag") -#plt.plot_date(day_diff, tickets, xdate=True, linestyle="solid", label="semesterticket", bottom=studw) -#plt.plot_date(day_diff, sem, xdate=True) -#plt.show() +if False: # single lines + plt.plot_date(day_diff, studw, xdate=True, linestyle="solid",label="studentenwerksbeitrag") + plt.plot_date(day_diff, tickets, xdate=True, linestyle="solid", label="semesterticket", bottom=studw) + plt.plot_date(day_diff, sem, xdate=True) +else: # stacked area + if False: # with semesterbeiträge + plt.stackplot(dates, (tickets, studw, sem), labels=("semesterticket","studentenwerksbeitrag", "semesterbeitrag")) + else: # only ticket & studentenwerk + plt.stackplot(dates, (tickets, studw), labels=("semesterticket","studentenwerksbeitrag")) -plt.stackplot(dates, (tickets, studw), labels=("semesterticket","studentenwerksbeitrag")) - plt.legend(loc="upper left") plt.savefig("semesterbeiträge.png")