Bus errorとSegmentation faultに困ったら見るブログ

物理の研究者による日々の研究生活のメモ書きです ( python/emacs/html/Japascript/シェルスクリプト/TeX/Mac/C言語/Linux/git/tmux/R/ポケモンGO)

【gnuplot 5】paletteを使ってグラデーションプロットを作るには

20本くらいの線を引くときに、色を手で指定していると大変なので、グラデーションを使ってみる

■ 参考 : gnuplotでグラデーション

■ 参考 : Gnuplot color interpolation for set of linear functions

■ 参考 : gnuplotで簡単に色を指定するためのちょっとしたTips



動くかわからんけど、こんな感じメモメモ
set paletteというのがミソ
あとcolorboxというのをunsetしないと右側に色の説明のためのbarが出る
それが必要ならunsetはコメントアウトしておく
#set palette rgb 33,13,10;
#set palette rgb 3, 2, 2;
set palette model HSV
unset colorbox
plot \
n=0, \
"hoge1.txt" u 1:2 w l lw 4 lc palette frac n/5,0 title "hoge1",\
n=2,\
"hoge1.txt" u 1:2 w l lw 4 lc palette frac n/5.0 title "hoge2",\
n=3,\
"hoge1.txt" u 1:2 w l lw 4 lc palette frac n/5.0 title "hoge3",\
n=4,\
"hoge1.txt" u 1:2 w l lw 4 lc palette frac n/5.0 title "hoge4",\
n=5,\
"hoge1.txt" u 1:2 w l lw 4 lc palette frac n/5.0 title "hoge5"

ランキング参加中です

↓クリックしていただけると嬉しいです〜