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

View File

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