]> rtime.felk.cvut.cz Git - coffee/coffee-flask.git/commitdiff
Add comments
authorMichal Sojka <michal.sojka@cvut.cz>
Fri, 31 Jul 2020 08:42:52 +0000 (10:42 +0200)
committerMichal Sojka <michal.sojka@cvut.cz>
Fri, 31 Jul 2020 08:42:52 +0000 (10:42 +0200)
app.py

diff --git a/app.py b/app.py
index d009705b817abd921fcbdbcbfc71e56180bd2069..b4d7e41d4a7e90175e08c8b8a71bccce9560a393 100644 (file)
--- a/app.py
+++ b/app.py
@@ -125,9 +125,11 @@ def coffee_graph_flavors():
     ax = fig.add_subplot(111)
     ax.set_aspect(1)
     if "normalize" in matplotlib.pyplot.pie.__code__.co_varnames:
+        # Matplotlib >= 3.3.0
         ax.pie(counts, autopct=lambda p: '{:.0f}'.format(p * sum(counts)/100) if p != 0 else '',
                normalize=True)
     else:
+        # Matplotlib < 3.3.0
         ax.pie(counts, autopct=lambda p: '{:.0f}'.format(p * sum(counts)/100) if p != 0 else '')
 
     ax.legend(flavors, bbox_to_anchor=(1.0, 1.0))