In [19]:
gem 'nyaplot', '0.1.5'


Out[19]:
false

In [3]:
require 'nyaplot'


Out[3]:
Out[3]:
true

In [4]:
include Nyaplot


Out[4]:
Object

In [5]:
def plot_line(fname)
    x_arr = []
    y_arr = []
    File.read(fname).split("\n").each do |str|
        a, b = str.split(" ").map{|s| s.to_f} 
        x_arr.push(a)
        y_arr.push(b)
    end
    p = Plot.new
    p.add(:line, x_arr, y_arr)
    p
end


Out[5]:
:plot_line

In [15]:
plot_line("/home/naoki/exp_c/compiled/42series_given_noise.dat")


Out[15]:

In [14]:
plot_line("/home/naoki/exp_c/compiled/42rev_dfted.dat")


Out[14]:

In [23]:
plot_line("/home/naoki/exp_c/compiled/42_real_part.dat")


Out[23]:

In [22]:
plot_line("/home/naoki/exp_c/compiled/42_imaginary_part.dat")


Out[22]:

In [18]:
plot_line("/home/naoki/exp_c/compiled/42re_dfted.dat")


Out[18]:

In [21]:
plot_line("/home/naoki/exp_c/compiled/42error.dat")


Out[21]: