From: Tomas Prochazka Date: Fri, 10 Aug 2018 10:35:48 +0000 (+0200) Subject: Fix axis-Y only integer numbers show X-Git-Url: https://rtime.felk.cvut.cz/gitweb/coffee/coffee-flask.git/commitdiff_plain/9f72dd97bf56d6f21b06faf92db8e35bcde9d417 Fix axis-Y only integer numbers show --- diff --git a/app.py b/app.py index 083114c..05a7dbc 100644 --- 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)