使用默认的线条颜色作为文本颜色

Use default linecolor as textcolor

Gnuplot 有一些默认的线条颜色。

如何用 textcolor 调用这些颜色?他们 name/identifier 是什么?

我试着做这样的事情:

set ylabel 'A' textcolor 'linecolor1'
set ylabel 'B' textcolor 'linecolor2'

我知道 ,但我想避免自己提取值,而是调用它们的标识符。

勾选help colorspec。我猜你正在寻找这样的东西:

代码:

### linecolors as textcolors
reset session

set label 1 at graph 0.2, 0.6 "Linecolor 1" tc lt 1
set label 2 at graph 0.2, 0.7 "Linecolor 2" tc lt 2
set label 3 at graph 0.2, 0.8 "Linecolor 3" tc lt 3
set label 4 at graph 0.2, 0.9 "Linecolor 4" tc lt 4
set key top left
plot x, 2*x, 3*x, 4*x

### end of code

结果: