如果您只需要大致的颜色印象,则可以采用以下简单,快速且肮脏的方法(仍需调整)。确保将set samples
其设置得足够高,以使您有足够的空间,impulses
并且不会出现白线(背景线)。如果您需要在另一个图形中使用此频谱,请multiplot
通过调整origin
和来创建一个插图size
。检查此与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
结果:
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句