fig = plt.figure(figsize=(3, 3))
ax = fig.add_subplot(111)
ax.set_aspect(1)
- ax.pie(counts, autopct=lambda p: '{:.0f}'.format(p * sum(counts)/100) if p != 0 else '',
- normalize=True)
+ if "normalize" in matplotlib.pyplot.pie.__code__.co_varnames:
+ ax.pie(counts, autopct=lambda p: '{:.0f}'.format(p * sum(counts)/100) if p != 0 else '',
+ normalize=True)
+ else:
+ 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))
if "uid" in session: