class Drnbench::Chart::Gnuplot

Public Class Methods

new() click to toggle source
# File lib/drnbench/chart/gnuplot.rb, line 21
def initialize
  @input = Tempfile.new("drnbench-graph")
  write(preamble)
end

Public Instance Methods

run() click to toggle source
# File lib/drnbench/chart/gnuplot.rb, line 30
def run
  @input.close
  unless system("gnuplot", @input.path)
    @input.open
    puts(@input.read)
    @input.close
  end
end
write(data) click to toggle source
# File lib/drnbench/chart/gnuplot.rb, line 26
def write(data)
  @input.write(data)
end

Private Instance Methods

preamble() click to toggle source
# File lib/drnbench/chart/gnuplot.rb, line 40
      def preamble
        <<-PREAMBLE
set terminal pdfcairo enhanced color transparent rounded

set key outside center top horizontal reverse Left samplen 2
unset border
set xtics scale 0
set ytics scale 0
set grid ytics linewidth 1 linetype -1

set style line 1 lt 1 lc rgbcolor "#3465a4" lw 2.5 pt 7 ps 1
set style line 2 lt 1 lc rgbcolor "#edd400" lw 2.5 pt 7 ps 1
set style line 3 lt 1 lc rgbcolor "#888a85" lw 2.5 pt 5 ps 1
set style line 4 lt 1 lc rgbcolor "#f57900" lw 2.5 pt 5 ps 1
set style line 5 lt 1 lc rgbcolor "#ad7fa8" lw 2.5 pt 9 ps 1
set style line 6 lt 1 lc rgbcolor "#4e9a06" lw 2.5 pt 9 ps 1
set style line 7 lt 1 lc rgbcolor "#ef2929" lw 2.5 pt 1 ps 1
set style line 8 lt 1 lc rgbcolor "#5c3566" lw 2.5 pt 1 ps 1
set style line 9 lt 1 lc rgbcolor "#c17d11" lw 2.5 pt 3 ps 1
set style line 10 lt 1 lc rgbcolor "#dce775" lw 2.5 pt 3 ps 1
        PREAMBLE
      end