如何在GNOUUPT中用可见光谱的颜色填充矩形? [英] How to fill a rectangle with colors of visible spectrum in gnuplot?
本文介绍了如何在GNOUUPT中用可见光谱的颜色填充矩形?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在图形中绘制由视觉光谱颜色填充的矩形?
将对象1矩形设置为从第一个6545,图形0到第一个6580,图形1填充颜色"?"
我在此enter link description here中找到了颜色。
请告诉我怎么做?
推荐答案
如果您只需要对颜色有一个粗略的印象,下面是一个简单、快速和肮脏的方法(仍有待调整)。请确保set samples
设置得足够高,以便您有足够的impulses
,并且不会出现白色(背景)线条。
如果您需要在另一个图中使用此频谱,请使用multiplot
通过调整origin
和size
创建一个插图。使用help multiplot
、help origin
和help size
在gnplot中检查这一点
但是,如果您需要更精确的颜色表示,请检查您提供的链接处的链接。
编码:
### 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
结果:
这篇关于如何在GNOUUPT中用可见光谱的颜色填充矩形?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文