如何为gnuplot方框图使用调色板索引?

如何为gnuplot方框图使用调色板索引?,gnuplot,Gnuplot,我尝试将一些索引映射到已定义调色板的颜色。但是定义的调色板似乎没有被使用 给定一个文件data.txt: 11 22 33 44 gnuplot命令: set nokey set grid set style fill solid set boxwidth 0.5 set yrange [0:] set palette model RGB maxcolors 7 set palette defined (0 'dark-violet', 1 'skyblue', 2 'dark-yellow'

我尝试将一些索引映射到已定义调色板的颜色。但是定义的调色板似乎没有被使用

给定一个文件
data.txt

11
22
33
44
gnuplot命令:

set nokey
set grid
set style fill solid
set boxwidth 0.5
set yrange [0:]
set palette model RGB maxcolors 7
set palette defined (0 'dark-violet', 1 'skyblue', 2 'dark-yellow', 3 'dark-green', 4 'dark-red', 5 'coral', 6 'green', 7 'purple')
plot 'data.txt' using 0:1:(column(0)+1) with boxes linecolor variable
这使得:


这与定义的调色板不匹配。如何让gnuplot使用这里定义的调色板和索引和颜色名称

这就是我提出的解决方案:

set nokey
set grid
set style fill solid
set yrange [0:]
set palette defined (0 'dark-violet', 1 'skyblue', 2 'dark-yellow', 3 'dark-green', 4 'dark-red', 5 'coral', 6 'green', 7 'purple')
set cbrange [0 : 7]
unset colorbox
plot 'data.txt' using 0:1:(0.5):(column(0)) with boxes linecolor palette
解决方案是在绘图行中添加方框宽度
(0.5)
,并使用
cbrange
linecolor调色板


如果你找到了这个或这个,肯定会有帮助……第一个会很有帮助,但似乎没有使用调色板。