Gnuplot 默认线条颜色 rgb 值

Gnuplot default line color rgb values

我正在使用 gnuplot 5.2 并希望获得与默认线条颜色关联的 rgb 值。使用命令 test 我得到了可用选项和参数的一个很好的总结,但默认颜色只是用 1, 2, 3, .... 标记并且没有显示 rgb 值。命令 show colors 也很有用,但它只显示颜色名称和 rgb 值,而不显示标签 1, 2, 3, ... 所以我不知道哪个是哪个。

我的目标是使用默认线条颜色和透明绘图线条。从这里的其他问题中,我了解到 5.2 版可以通过颜色规范 lc rgb #aarrggbb 但是为此我需要知道 rgb 值。

而且 gnuplot 似乎没有包含默认行颜色的简单文本配置文件(我在 fedora 上),rpm -ql gnuplot 没有显示任何此类配置文件,所以我有点迷路。

在 gnuplot 5.2 中,您可以通过 test palette 从当前调色板将 rgb 颜色值获取到数据块 $PALETTE 中。检查 help palette.

所以如果你这样做:

test palette
print $PALETTE

你会得到...

0.0000 0.0000 0.0000 0.0000 0.0000 
0.0039 0.0626 0.0000 0.0246 0.0215 
0.0078 0.0886 0.0000 0.0493 0.0321 
0.0118 0.1085 0.0000 0.0739 0.0409 
0.0157 0.1252 0.0000 0.0984 0.0487 
0.0196 0.1400 0.0000 0.1229 0.0559 
...
0.4941 0.7029 0.1206 0.0370 0.2852 
0.4980 0.7057 0.1235 0.0123 0.2849 
0.5020 0.7085 0.1265 0.0000 0.2861 
0.5059 0.7113 0.1295 0.0000 0.2887 
0.5098 0.7140 0.1325 0.0000 0.2913 
0.5137 0.7167 0.1356 0.0000 0.2939 
0.5176 0.7195 0.1387 0.0000 0.2965 
...
0.9725 0.9862 0.9199 0.0000 0.8348 
0.9765 0.9882 0.9311 0.0000 0.8420 
0.9804 0.9901 0.9423 0.0000 0.8492 
0.9843 0.9921 0.9537 0.0000 0.8565 
0.9882 0.9941 0.9651 0.0000 0.8638 
0.9922 0.9961 0.9767 0.0000 0.8711 
0.9961 0.9980 0.9883 0.0000 0.8785 
1.0000 1.0000 1.0000 0.0000 0.8860 

然后就看你到底想用它做什么了。

加法:

好的,你说的是当你输入 test 时出现的颜色,对吗? 这就是我用 wxt 终端得到的。

gnuplot 子文件夹 share 中有一个名为 colors_default.gp 的文件。

# Ethan A Merritt - my preference for gnuplot colors
# 2 3 4 5 6 8 are borrowed from the colors_podo set
#
set linetype  1 lc rgb "dark-violet" lw 1
set linetype  2 lc rgb "#009e73" lw 1
set linetype  3 lc rgb "#56b4e9" lw 1
set linetype  4 lc rgb "#e69f00" lw 1
set linetype  5 lc rgb "#f0e442" lw 1
set linetype  6 lc rgb "#0072b2" lw 1
set linetype  7 lc rgb "#e51e10" lw 1
set linetype  8 lc rgb "black"   lw 1
set linetype  9 lc rgb "gray50"  lw 1
set linetype cycle  9

其中:

dark-violet = #9400d3
black       = #000000

然而,显然,颜色(在测试屏幕中)以 8 的周期重复。

简单回答:

gnuplot> show linetype

        linetype 1,  linecolor rgb "dark-violet"  linewidth 1.000 dashtype solid pointtype 1 pointsize default
        linetype 2,  linecolor rgb "#009e73"  linewidth 1.000 dashtype solid pointtype 2 pointsize default
        linetype 3,  linecolor rgb "#56b4e9"  linewidth 1.000 dashtype solid pointtype 3 pointsize default
        linetype 4,  linecolor rgb "#e69f00"  linewidth 1.000 dashtype solid pointtype 4 pointsize default
        linetype 5,  linecolor rgb "#f0e442"  linewidth 1.000 dashtype solid pointtype 5 pointsize default
        linetype 6,  linecolor rgb "#0072b2"  linewidth 1.000 dashtype solid pointtype 6 pointsize default
        linetype 7,  linecolor rgb "#e51e10"  linewidth 1.000 dashtype solid pointtype 7 pointsize default
        linetype 8,  linecolor rgb "black"  linewidth 1.000 dashtype solid pointtype 8 pointsize default
        Linetypes repeat every 8 unless explicitly defined