require 'nyaplot' path = File.expand_path("../data/11-1-result0.3.csv", __FILE__) df = Nyaplot::DataFrame.from_csv(path) Nyaplot.init_iruby 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