]> rtime.felk.cvut.cz Git - coffee/coffee-flask.git/commitdiff
Fix axis-Y only integer numbers show
authorTomas Prochazka <tomas.prochazka@cvut.cz>
Fri, 10 Aug 2018 10:35:48 +0000 (12:35 +0200)
committerMichal Sojka <michal.sojka@cvut.cz>
Fri, 10 Aug 2018 10:49:21 +0000 (12:49 +0200)
app.py

diff --git a/app.py b/app.py
index 083114cc966db21df5086c2f24257a120b79a5c7..05a7dbcaaa803043e1fb6251039e5a438e1110ef 100644 (file)
--- a/app.py
+++ b/app.py
@@ -5,6 +5,7 @@ import numpy as np
 import matplotlib
 matplotlib.use('Agg')
 import matplotlib.pyplot as plt
+from matplotlib.ticker import MaxNLocator
 from io import BytesIO
 
 import coffee_db as db
@@ -133,6 +134,7 @@ def coffee_graph_history():
     ax.set_xticks(range(len(days)))
     ax.set_xticklabels(xdays)
     ax.set_title("Your week")
+    ax.yaxis.set_major_locator(MaxNLocator(integer=True))
     fig.savefig(b, format="svg", bbox_inches="tight")
     b.seek(0)
     plt.close(fig)