From 60d77be27c386e26aabb8e95170bad19db754890 Mon Sep 17 00:00:00 2001 From: Mikhail Zakharov Date: Fri, 11 Dec 2020 20:12:18 -0500 Subject: [PATCH] float midpoint --- main.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 92fec5b..0164281 100644 --- a/main.py +++ b/main.py @@ -278,8 +278,9 @@ def get_value(self, dt): self.gr_cache[gr] = (gr.ymax, gr.ymin, gr.y_ticks_major) #center graphs - midpoint = int(np.round(midpoints[i])) - gr.xlabel = f'{labels[i]} @ {midpoint}' + midpoint = midpoints[i] + gr.xlabel = f'{labels[i]} @ {midpoint:.1f}' + midpoint = int(np.round(midpoint)) ZOOM_DEGREES = 20 gr.ymax = midpoint + ZOOM_DEGREES gr.ymin = midpoint - ZOOM_DEGREES @@ -288,7 +289,7 @@ def get_value(self, dt): cache = self.gr_cache.pop(gr, None) if cache is not None: gr.ymax, gr.ymin, gr.y_ticks_major = cache - gr.xlabel = f'{labels[i]} @ {np.median(values[-10:]):.1f}' + gr.xlabel = f'{labels[i]} @ {values[-1]:.1f}' gr.xmax = len(values) plot.points = enumerate(values)