x = Array(Float64).new(100){ rand(10.0..20.0) } y = Array(Float64).new(100){ rand(100.0..200.0) } Gnuplot.plot do |s| s << "set title 'SCATTER'" s << "plot '-' pt 6 lt rgb 'red' t 'circle'" s << to_gp([x, y]) end memo = 0 x = Array(Float64).new(100,0.0) 100.times do |i| memo = memo + rand(-0.9..1.0) x[i] = memo end Gnuplot.plot do |s| s << "set title 'LINES'" s << "plot '-' with lines title 'x'" s
