In [1]:
require 'nyaplot'


Out[1]:
Out[1]:
true

In [2]:
path = File.expand_path("../data/11-2-result0.01.csv", __FILE__)
df = Nyaplot::DataFrame.from_csv(path)


Out[2]:
tvw
0.0-0.7568363.812226
0.1-0.045113.40354
0.2-2.0177093.075507
0.31.7095062.679731
0.40.5708582.645426
0.5-1.1008742.490375
0.6-1.2781262.191405
0.7-1.3280451.913642
0.8-1.5149091.661195
0.9-1.5726891.425256
1.0-1.6581161.211392
1.1-1.6903511.016707
1.2-1.6647590.841834
1.3-1.5974330.686942
1.4-1.5115240.551852
1.5-1.4169290.435926
.........
100.01.4323781.528758

In [4]:
plot1 = Nyaplot::Plot.new
plot2 = Nyaplot::Plot.new
plot3 = Nyaplot::Plot.new
colors=["#3182bd","#31a354"]
["1.0","0.1"].each do |str|
  path = File.expand_path("../data/11-2-result" + str + ".csv", __FILE__)
  df = Nyaplot::DataFrame.from_csv(path)
  line1 = plot1.add_with_df(df, :line, 't', 'v')
  line2 = plot2.add_with_df(df, :line, 't', 'w')
  line3 = plot3.add_with_df(df, :line, 'v', 'w')
  color=colors.pop
  title="I0 ="+str
  line1.color(color);line2.color(color);line3.color(color);
  line1.title(title);line2.title(title);line3.title(title);
end
plot1.legend(true); plot2.legend(true); plot3.legend(true)

frame = Nyaplot::Frame.new
frame.add(plot1)
frame.add(plot2)
frame.add(plot3)
frame.show


Out[4]:

In [ ]: