Colors 如何在gnuplot中用可见光谱的颜色填充矩形?

Colors 如何在gnuplot中用可见光谱的颜色填充矩形?,colors,gnuplot,Colors,Gnuplot,如何在图形的矩形中绘制由视觉光谱颜色填充的矩形 我们绘制的矩形如下所示: 将对象1矩形从第一个6545、图形0设置为第一个6580、图形1填充颜色设置为“?” 我在这里面找到了颜色 如何做到这一点,请?如果您只需要对颜色有一个粗略的印象,下面是一个简单、快速和肮脏的方法(仍有待调整)。确保set samples设置得足够高,以便您有足够的脉冲,并且不会出现白线(背景)。 如果您需要在另一个图形中使用此光谱,请通过调整原点和大小创建一个带有多点的插入图。在gnuplot中使用help multi

如何在图形的矩形中绘制由视觉光谱颜色填充的矩形

我们绘制的矩形如下所示:

将对象1矩形从第一个6545、图形0设置为第一个6580、图形1填充颜色设置为“?”

我在这里面找到了颜色


如何做到这一点,请?

如果您只需要对颜色有一个粗略的印象,下面是一个简单、快速和肮脏的方法(仍有待调整)。确保
set samples
设置得足够高,以便您有足够的
脉冲
,并且不会出现白线(背景)。 如果您需要在另一个图形中使用此光谱,请通过调整
原点
大小
创建一个带有
多点
的插入图。在gnuplot中使用
help multiplot
help origin
help size

但是,如果您需要更精确的颜色表示,请检查您提供的链接处的链接

代码:

### visible spectrum ("quick and dirty")
reset session

set palette defined (380 "black", 400 "dark-violet", 440 "blue",  490 '#00b0c0', 530 "green", 560 "yellow", 620 "red", 780 "black")

set samples 1000
unset colorbox

plot [380:780] '+' u 1:(1):1 w impulse lc palette notitle
### end of code
### visible spectrum ("quick and dirty")
# inserted into another plot
reset session

set palette defined (380 "black", 400 "dark-violet", 440 "blue",  490 '#00b0c0', 530 "green", 560 "yellow", 620 "red", 780 "black")

set samples 1000
unset colorbox

set multiplot 
    plot cos(x)+0.2*x

    set origin 0.05,0.75
    set size 0.45, 0.2
    unset tics
    plot [380:780] '+' u 1:(1):1 w impulse lc palette lw 1 notitle

unset multiplot
### end of code
### visible spectrum ("quick and dirty")
# below curve
reset session

set palette defined (380 "black", 400 "dark-violet", 440 "blue",  490 '#00b0c0', 530 "green", 560 "yellow", 620 "red", 780 "black")

set samples 1000
unset colorbox

f(x) = sin((x-380)/25)*cos((x-580)/10) + 2

plot [380:780] '+' u 1:(f(x)):1 w impulse lc palette notitle, \
     f(x) w l lw 2 lc rgb "black" notitle
### end of code
结果:

### visible spectrum ("quick and dirty")
reset session

set palette defined (380 "black", 400 "dark-violet", 440 "blue",  490 '#00b0c0', 530 "green", 560 "yellow", 620 "red", 780 "black")

set samples 1000
unset colorbox

plot [380:780] '+' u 1:(1):1 w impulse lc palette notitle
### end of code
### visible spectrum ("quick and dirty")
# inserted into another plot
reset session

set palette defined (380 "black", 400 "dark-violet", 440 "blue",  490 '#00b0c0', 530 "green", 560 "yellow", 620 "red", 780 "black")

set samples 1000
unset colorbox

set multiplot 
    plot cos(x)+0.2*x

    set origin 0.05,0.75
    set size 0.45, 0.2
    unset tics
    plot [380:780] '+' u 1:(1):1 w impulse lc palette lw 1 notitle

unset multiplot
### end of code
### visible spectrum ("quick and dirty")
# below curve
reset session

set palette defined (380 "black", 400 "dark-violet", 440 "blue",  490 '#00b0c0', 530 "green", 560 "yellow", 620 "red", 780 "black")

set samples 1000
unset colorbox

f(x) = sin((x-380)/25)*cos((x-580)/10) + 2

plot [380:780] '+' u 1:(f(x)):1 w impulse lc palette notitle, \
     f(x) w l lw 2 lc rgb "black" notitle
### end of code

添加:

### visible spectrum ("quick and dirty")
reset session

set palette defined (380 "black", 400 "dark-violet", 440 "blue",  490 '#00b0c0', 530 "green", 560 "yellow", 620 "red", 780 "black")

set samples 1000
unset colorbox

plot [380:780] '+' u 1:(1):1 w impulse lc palette notitle
### end of code
### visible spectrum ("quick and dirty")
# inserted into another plot
reset session

set palette defined (380 "black", 400 "dark-violet", 440 "blue",  490 '#00b0c0', 530 "green", 560 "yellow", 620 "red", 780 "black")

set samples 1000
unset colorbox

set multiplot 
    plot cos(x)+0.2*x

    set origin 0.05,0.75
    set size 0.45, 0.2
    unset tics
    plot [380:780] '+' u 1:(1):1 w impulse lc palette lw 1 notitle

unset multiplot
### end of code
### visible spectrum ("quick and dirty")
# below curve
reset session

set palette defined (380 "black", 400 "dark-violet", 440 "blue",  490 '#00b0c0', 530 "green", 560 "yellow", 620 "red", 780 "black")

set samples 1000
unset colorbox

f(x) = sin((x-380)/25)*cos((x-580)/10) + 2

plot [380:780] '+' u 1:(f(x)):1 w impulse lc palette notitle, \
     f(x) w l lw 2 lc rgb "black" notitle
### end of code
也许是这样的:

代码:

### visible spectrum ("quick and dirty")
reset session

set palette defined (380 "black", 400 "dark-violet", 440 "blue",  490 '#00b0c0', 530 "green", 560 "yellow", 620 "red", 780 "black")

set samples 1000
unset colorbox

plot [380:780] '+' u 1:(1):1 w impulse lc palette notitle
### end of code
### visible spectrum ("quick and dirty")
# inserted into another plot
reset session

set palette defined (380 "black", 400 "dark-violet", 440 "blue",  490 '#00b0c0', 530 "green", 560 "yellow", 620 "red", 780 "black")

set samples 1000
unset colorbox

set multiplot 
    plot cos(x)+0.2*x

    set origin 0.05,0.75
    set size 0.45, 0.2
    unset tics
    plot [380:780] '+' u 1:(1):1 w impulse lc palette lw 1 notitle

unset multiplot
### end of code
### visible spectrum ("quick and dirty")
# below curve
reset session

set palette defined (380 "black", 400 "dark-violet", 440 "blue",  490 '#00b0c0', 530 "green", 560 "yellow", 620 "red", 780 "black")

set samples 1000
unset colorbox

f(x) = sin((x-380)/25)*cos((x-580)/10) + 2

plot [380:780] '+' u 1:(f(x)):1 w impulse lc palette notitle, \
     f(x) w l lw 2 lc rgb "black" notitle
### end of code
结果:

### visible spectrum ("quick and dirty")
reset session

set palette defined (380 "black", 400 "dark-violet", 440 "blue",  490 '#00b0c0', 530 "green", 560 "yellow", 620 "red", 780 "black")

set samples 1000
unset colorbox

plot [380:780] '+' u 1:(1):1 w impulse lc palette notitle
### end of code
### visible spectrum ("quick and dirty")
# inserted into another plot
reset session

set palette defined (380 "black", 400 "dark-violet", 440 "blue",  490 '#00b0c0', 530 "green", 560 "yellow", 620 "red", 780 "black")

set samples 1000
unset colorbox

set multiplot 
    plot cos(x)+0.2*x

    set origin 0.05,0.75
    set size 0.45, 0.2
    unset tics
    plot [380:780] '+' u 1:(1):1 w impulse lc palette lw 1 notitle

unset multiplot
### end of code
### visible spectrum ("quick and dirty")
# below curve
reset session

set palette defined (380 "black", 400 "dark-violet", 440 "blue",  490 '#00b0c0', 530 "green", 560 "yellow", 620 "red", 780 "black")

set samples 1000
unset colorbox

f(x) = sin((x-380)/25)*cos((x-580)/10) + 2

plot [380:780] '+' u 1:(f(x)):1 w impulse lc palette notitle, \
     f(x) w l lw 2 lc rgb "black" notitle
### end of code

另一个变化:

代码:

### visible spectrum ("quick and dirty")
reset session

set palette defined (380 "black", 400 "dark-violet", 440 "blue",  490 '#00b0c0', 530 "green", 560 "yellow", 620 "red", 780 "black")

set samples 1000
unset colorbox

plot [380:780] '+' u 1:(1):1 w impulse lc palette notitle
### end of code
### visible spectrum ("quick and dirty")
# inserted into another plot
reset session

set palette defined (380 "black", 400 "dark-violet", 440 "blue",  490 '#00b0c0', 530 "green", 560 "yellow", 620 "red", 780 "black")

set samples 1000
unset colorbox

set multiplot 
    plot cos(x)+0.2*x

    set origin 0.05,0.75
    set size 0.45, 0.2
    unset tics
    plot [380:780] '+' u 1:(1):1 w impulse lc palette lw 1 notitle

unset multiplot
### end of code
### visible spectrum ("quick and dirty")
# below curve
reset session

set palette defined (380 "black", 400 "dark-violet", 440 "blue",  490 '#00b0c0', 530 "green", 560 "yellow", 620 "red", 780 "black")

set samples 1000
unset colorbox

f(x) = sin((x-380)/25)*cos((x-580)/10) + 2

plot [380:780] '+' u 1:(f(x)):1 w impulse lc palette notitle, \
     f(x) w l lw 2 lc rgb "black" notitle
### end of code
结果:

### visible spectrum ("quick and dirty")
reset session

set palette defined (380 "black", 400 "dark-violet", 440 "blue",  490 '#00b0c0', 530 "green", 560 "yellow", 620 "red", 780 "black")

set samples 1000
unset colorbox

plot [380:780] '+' u 1:(1):1 w impulse lc palette notitle
### end of code
### visible spectrum ("quick and dirty")
# inserted into another plot
reset session

set palette defined (380 "black", 400 "dark-violet", 440 "blue",  490 '#00b0c0', 530 "green", 560 "yellow", 620 "red", 780 "black")

set samples 1000
unset colorbox

set multiplot 
    plot cos(x)+0.2*x

    set origin 0.05,0.75
    set size 0.45, 0.2
    unset tics
    plot [380:780] '+' u 1:(1):1 w impulse lc palette lw 1 notitle

unset multiplot
### end of code
### visible spectrum ("quick and dirty")
# below curve
reset session

set palette defined (380 "black", 400 "dark-violet", 440 "blue",  490 '#00b0c0', 530 "green", 560 "yellow", 620 "red", 780 "black")

set samples 1000
unset colorbox

f(x) = sin((x-380)/25)*cos((x-580)/10) + 2

plot [380:780] '+' u 1:(f(x)):1 w impulse lc palette notitle, \
     f(x) w l lw 2 lc rgb "black" notitle
### end of code

非常感谢,如何将其与另一个图表连接起来?有比多点法更简单的方法吗?