gnuplotでラベルとラインを同じ色に設定する方法に関連していますが、まったく同じではありません...このコードを使用すると:
set style line 1 linetype 1 linewidth 2 pointtype 3 linecolor rgb "aquamarine"
set style line 2 linetype 1 linewidth 2 pointtype 3 linecolor rgb "blue"
set style line 3 linetype 1 linewidth 2 pointtype 3 linecolor rgb "coral"
set xrange [0:3]
set yrange [0:3]
# function to get style index for coloring:
getCol(x) = (x==0)?1:((x==1)?2:3);
plot \
'-' using ($1+0.5):($2+0.5):(getCol($2)) with impulses \
lc variable notitle, \
"" using ($1+0.5):($2+0.5):(stringcolumn(2)):(getCol($2)) with labels \
textcolor variable point linestyle 1 pointtype 7 lc variable \
font ",6" offset character 1.0,character 1.0 notitle
0 0
1 1
1.5 1
2 2
e
0 0
1 1
1.5 1
2 2
e
... この出力が得られます。
の色付けにはすべて問題ないように見えますがimpulses
、 のlabels
場合、アプローチは機能しているように見えますが、色が別のインデックスから読み取られているようです ?!
では、インパルス ラインと同じ関数を使用して、ポイントとラベルに同じ可変色を持たせるにはどうすればよいでしょうか。これはgnuplot 4.6パッチレベル1にあります...