Skip to content

Commit

Permalink
float midpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
mzakharo committed Dec 12, 2020
1 parent 56133ae commit 60d77be
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit 60d77be

Please sign in to comment.