#/*********************************************************** # window.rb -- グラフィックス #***********************************************************/ # 座標変換 def gr_on $gplot = IO.popen("gnuplot -persist", "w") end def gr_off $gplot.close end def gr_plot_start $gplot.puts 'plot "-" w d' end def gr_plot_end $gplot.puts "end" end def gr_wdot(x, y) # gr_window() で定めた座標で点 (x, y) を描く $gplot.puts "#{x} #{y}" end def gr_window(left, bottom, right, top, samescale, bordercolor) # 窓の左・下・右・上端の座標を指定する. $gplot.puts "set xrange[#{left}:#{right}]" $gplot.puts "set yrange[#{bottom}:#{top}]" end