2014年6月5日木曜日

Gnuplotで指定範囲の背景を塗りつぶす

グラフを描く時に,y軸方向にこの範囲に数値が入っていれば良い,ということを伝える為に,グラフの指定範囲の背景に色を入れる.方法としてはその範囲に長方形オブジェクトを配置する.

$ set object 1 rect from graph 始点x, graph 始点y to graph 終点x, graph 終点y back linewidth 0 fillcolor rgb "cyan" fill solid 0.5

“set object 1 rect” で長方形の指定
“from graph 始点x, graph 始点y” で長方形の左下の頂点を指定
“to graph 終点x, graph 終点y” で長方形の右上の頂点を指定
頂点の指定はグラフ中の割合で行う.
“back” で背面に配置
“linewidth 0” は辺の線幅を指定
“fillcolor rgb "cyan"” で色指定
“fill solid 0.5” で透明度の指定

0 件のコメント:

コメントを投稿