From 09e8aeb5c09c254cf51420ed95cf54c158784adc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoffer=20M=C3=BCller=20Madsen?= Date: Tue, 23 May 2017 00:09:29 +0200 Subject: [PATCH] colors are now fixed (as in, not random) --- plot.rb | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/plot.rb b/plot.rb index 768154a..84b4345 100644 --- a/plot.rb +++ b/plot.rb @@ -4,7 +4,10 @@ load 'config.rb' users = USERNAMES log_dir = LOG_DIR -colors = {} +colors = {"christoffermadsen" => "1d6a6f", + "jmaa" => "9db512", + "jacob" => "e01476", + "alexander" => "00c0c7"} def rand_color "%06x" % (rand * 0xffffff) @@ -16,14 +19,14 @@ def color_dist (c1, c2) (c1[4..5].hex - c2[4..5].hex).abs end -users.each do |user| - tentative_color = rand_color - while (colors.detect {|k,v| color_dist(v,tentative_color) < 200}) do - tentative_color = rand_color - end - - colors[user] = tentative_color -end +#users.each do |user| +# tentative_color = rand_color +# while (colors.detect {|k,v| color_dist(v,tentat#ive_color) < 200}) do +# tentative_color = rand_color +# end +# +# colors[user] = tentative_color +#end plotstring = %Q[set terminal 'svg' size 800,400 fname 'Verdana, Helvetica, Arial, sans-serif' \ fsize '14' rounded dashed @@ -57,7 +60,7 @@ plotstring += %Q[ set title "Screenshot size" set output "/home/christoffermadsen/public_html/img/screenshot_size.svg" set ylabel "Size (MB)" -set yrange [0:100] +set yrange [0:] set ytics 10 set mytics 1