In [2]:
gem 'nyaplot', '0.1.6'


Out[2]:
true

In [3]:
require 'nyaplot'


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

5-1

Fourier Series


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


Out[14]:

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


Out[15]:

SAMPLE_NUM = 9


In [16]:
plot_line("/home/naoki/exp_c/compiled/51averaged4.dat")


Out[16]:

SAMPLE_NUM = 11


In [17]:
plot_line("/home/naoki/exp_c/compiled/51averaged10.dat")


Out[17]:

SAMPLE_NUM = 41


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


Out[18]:

5-2


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


Out[21]:

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


Out[22]:

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


Out[23]:

5-3


In [19]:
plot_line("/home/naoki/exp_c/compiled/53given_noise.dat")


Out[19]:

In [20]:
plot_line("/home/naoki/exp_c/compiled/53real_part.dat")


Out[20]:

In [26]:
plot_line("/home/naoki/exp_c/compiled/53imaginary_part.dat")


Out[26]:

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


Out[22]:

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


Out[23]:

In [24]:
plot_line("/home/naoki/exp_c/compiled/53low_pass50.dat")


Out[24]:

In [25]:
plot_line("/home/naoki/exp_c/compiled/53high_pass50.dat")


Out[25]:

In [13]:
plot_line("/home/naoki/exp_c/compiled/53low_pass3.dat")


Out[13]:

In [12]:
plot_line("/home/naoki/exp_c/compiled/53high_pass3.dat")


Out[12]: