updated xrange

This commit is contained in:
Christoffer Müller Madsen 2017-01-26 16:08:01 +01:00
parent 465c2735ee
commit e5dac03c61
2 changed files with 9 additions and 3 deletions

11
plot.rb
View File

@ -1,12 +1,14 @@
# coding: utf-8
users = ["christoffermadsen","jmaa","jacob","alexander"]
colors = {}
users.each do |user|
colors[user] = "%06x" % (rand * 0xffffff)
end
log_dir = "./log/"
plotstring = %Q[set terminal 'svg' size 800,400
set key bottom outside
plotstring = %Q[set terminal 'svg' size 800,400 fname 'Verdana, Helvetica, Arial, sans-serif' \
fsize '14' rounded dashed
set key top left outside
set style line 1 lt 1 lw 2 pt 7 ps 0.4
@ -14,7 +16,8 @@ set xlabel "Time"
set xdata time
set timefmt "%s"
set format x "%m/%d"
set xtics 172800
set xtics 60*60*24
set xrange [1485275000:]
set mxtics 2
set grid ytics mytics xtics mxtics
@ -49,3 +52,5 @@ end
output = File.open("plotscript","w")
output << plotstring
output.close
`gnuplot plotscript`

View File

@ -8,6 +8,7 @@ users.each do |user|
[size,count].each do |x|
x.delete! "\n"
end
output = File.open("#{log_dir}/#{user}.log","a")
output << "#{Time.now.to_i} #{count} #{size}\n"
output.close