Gnuplot:加载调色板?

Gnuplot: loading palette?

我当然遗漏了一些非常明显的东西,但是如何更改 Gnuplot 使用的基本颜色(可以通过命令 test 看到)?

我想定义一些颜色,然后能够将它们用作 linecolor 1 等的基本颜色

这是一个示例,根据我的理解,它应该覆盖颜色——但它没有:

set palette defined (0 '#A6CEE3',\
                     1 '#1F78B4',\
                     2 '#B2DF8A',\
                     3 '#33A02C',\
                     4 '#FB9A99',\
                     5 '#E31A1C',\
                     6 '#FDBF6F',\
                     7 '#FF7F00' )
set style arrow 1 \
    nohead \
    linecolor 1 \
    linewidth 2
set style arrow 2 \
    nohead \
    linecolor 2 \
    linewidth 4
set style line 3 \
    linetype 1 \
    linewidth 3 \
    linecolor 3
set xrange [-10:10]
set yrange [-2:10]
set arrow from 1,-2 to 1,10 arrowstyle 1
set arrow from -10,3 to 10,3 arrowstyle 1
plot sin(x) with lines linestyle 3, \
    5 with vectors arrowstyle 2

颜色取自 paired palette, while on the graph Gnuplot 仍然使用默认颜色(可以在背景上看到,这是 test 命令输出的一部分)。

似乎调色板用于将连续的模拟值转换为平滑的颜色选择。您只想 "index" 在您指定的定义点进入调色板,使用离散值 0、1 ... 7 来获得颜色。 如果使用 linecolor palette cbindex 形式的 colourspec,看起来就可以做到这一点。您需要先设置 "colourbar" 的范围。尝试

set cbrange [0:7]
set style arrow 1 \
    nohead \
    linecolor palette cb 1 \
    linewidth 2
set style arrow 2 \
    nohead \
    linecolor palette cb 2 \
    linewidth 4
set style line 3 \
    linetype 1 \
    linewidth 3 \
    linecolor palette cb 3

添加 unset colorbox 以不在右侧显示颜色范围。

我可能误解了原来的问题,但我认为这是一个关于如何更改基本线型 1 到 N 使用的颜色集的信息请求,如 "test" 命令所示。所需的命令是:

set linetype 1 lc '#A6CEE3'
set linetype 2 lc '#1F78B4'
set linetype 3 lc '#B2DF8A'
set linetype 4 lc '#33A02C'
set linetype 5 lc '#FB9A99'
set linetype 6 lc '#E31A1C'
set linetype 7 lc '#FDBF6F'
set linetype 8 lc '#FF7F00'
set linetype cycle 8

这成为一个新的颜色序列,用于生成连续的绘图元素并由 "test" 命令显示。最后一行告诉它在线型 9(和 17、25,...)处重新启动相同的颜色序列。