capacity limiter and general cleanup

This commit is contained in:
2020-05-13 13:56:43 -05:00
parent a43b3b4e1e
commit 403506a0b0
10 changed files with 121 additions and 50 deletions

View File

@ -181,6 +181,7 @@ def draw_plot_png_bytes(data, scale, size_x=3, size_y=1):
my_plot.xaxis.set_major_formatter(day_formatter)
max_value = reduce(lambda a, b: a if a > b else b, y, scale)
average=(sum(y)/len(y))/scale
average=average*1.25+0.1
@ -195,11 +196,8 @@ def draw_plot_png_bytes(data, scale, size_x=3, size_y=1):
my_plot.fill_between( x, y, color=highlight_color, alpha=0.3)
my_plot.plot(x, y, 'r-', color=highlight_color)
my_plot.patch.set_facecolor('red')
my_plot.patch.set_alpha(0.5)
if size_y < 4:
my_plot.set_yticks([0, scale*0.5, scale])
my_plot.set_yticks([0, scale])
my_plot.set_ylim(0, scale)
my_plot.xaxis.label.set_color(highlight_color)