しょんぼり技術メモ

まいにちがしょんぼり

2011-06-28から1日間の記事一覧

Drawing horizontal lines in specified range with Gnuplot

to draw horizontal lines with Gnuplot, define a function like this: step(x,from,to,y)=( (from <= x) && (x <= to) ) ? y : 0/0 # draw y=7, horizontal line, in range: 5<=x<=7 plot step(x, 5, 10, 7) points are: gnuplot abandons drawing if NaN …

gnuplotで区間を指定して横線を描きたい

step(x,from,to,y)=( (from <= x) && (x <= to) ) ? y : 0/0 # 5≦x≦10のあいだだけ、y=7の横線を描く plot step(x, 5, 10, 7) 以上。 あそんでみる こんな感じのスクリプト #!/bin/env ruby height = 50 length = 3 str = <