In [1]:
require 'nyaplot'
Out[1]:
Out[1]:
true
In [2]:
path = File.expand_path("../data/11-1-result0.3.csv", __FILE__)
df = Nyaplot::DataFrame.from_csv(path)
Out[2]:
tvw
0.02.2869444.001058
0.011.8321053.996535
0.021.4765173.988085
0.031.1627033.976401
0.040.8616623.961766
0.050.5548213.944233
0.060.2283883.923697
0.07-0.1275663.899931
0.08-0.5166773.872644
0.09-0.9310573.841559
0.1-1.3464553.806563
0.11-1.7255023.767856
0.12-2.0335413.726014
0.13-2.2560133.681861
0.14-2.4009053.636245
0.15-2.4876383.589856
.........
99.99-0.993297-0.366622
In [3]:
Nyaplot.init_iruby
Out[3]:
In [4]:
plot1 = Nyaplot::Plot.new
plot2 = Nyaplot::Plot.new
plot3 = Nyaplot::Plot.new
colors=["#3182bd","#31a354"]
(3..4).each do |i|
  path = File.expand_path("../data/11-1-result0." + i.to_s + ".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 ="+i.to_s
  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]: