From 13406721ae7e7270bc8eb400d82b9f412a19745c Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Mon, 26 Aug 2019 02:03:33 +0100 Subject: [PATCH] minor gui update --- tqdm/_tqdm_gui.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tqdm/_tqdm_gui.py b/tqdm/_tqdm_gui.py index c049a2ab..b77fdab6 100644 --- a/tqdm/_tqdm_gui.py +++ b/tqdm/_tqdm_gui.py @@ -54,7 +54,8 @@ class tqdm_gui(tqdm): # pragma: no cover self.mininterval = max(self.mininterval, 0.5) self.fig, ax = plt.subplots(figsize=(9, 2.2)) # self.fig.subplots_adjust(bottom=0.2) - if self.total: + total = len(self) + if total is not None: self.xdata = [] self.ydata = [] self.zdata = [] @@ -65,7 +66,7 @@ class tqdm_gui(tqdm): # pragma: no cover self.line1, = ax.plot(self.xdata, self.ydata, color='b') self.line2, = ax.plot(self.xdata, self.zdata, color='k') ax.set_ylim(0, 0.001) - if self.total: + if total is not None: ax.set_xlim(0, 100) ax.set_xlabel('percent') self.fig.legend((self.line1, self.line2), ('cur', 'est'),