2016-01-13 128 views
0

我想在gnuplot中有一个透明的渐变背景。在我的脚本中,我有一些箭头。但是,问题是,当我有背景时,箭头不显示。这里是没有背景的代码:gnuplot trasparent渐变背景

set arrow from x1_l, 0 to x1_l, 1.0 nohead lc rgb 'red' 
set arrow from x1_r, 0 to x1_r, 1.0 nohead lc rgb 'red' 

plot "..\\Points.txt" using 1:2 t "Point" lc rgb "blue" 

这里是输出: Plot without background

当我添加背景(我需要一个梯度背景)用下面的代码,箭头消失。

set table 'shadowkey.dat' 
splot [xl:xh] [yl:yh] x/(xh-xl) 
unset table 

set arrow from x1_l, 0 to x1_l, 1.0 nohead lc rgb 'red' 
set arrow from x1_r, 0 to x1_r, 1.0 nohead lc rgb 'red' 

unset colorbox 
set palette defined (0 "#8888ff", 1 "#ffffff") 
plot [0.8:0.95] [0:1] 'shadowkey.dat' w ima, \ 
"\\Points.txt" using 1:2 t "Point" lc rgb "blue" 

此外,我想有一个图,其中渐变背景将与两条红线。我怎样才能做到这一点?

实施例: Background in a region

预先感谢。

回答

1

使用front关键字:

set arrow from x1_l, 0 to x1_l, 1.0 nohead lc rgb 'red' front 
set arrow from x1_r, 0 to x1_r, 1.0 nohead lc rgb 'red' front 

set object 1 rectangle from x1_l, 0 to x1_r, 1.0 fc rgb "cyan" fs solid 1.0 front 

得到梯度只是行内:

set table 'shadowkey.dat' 
splot [x1_l:x1_r] [0:1] x/(xh-xl) 
unset table 

也许更好的离开线和梯度之间的空间:

set table 'shadowkey.dat' 
my_val=(x1_r-x1_l)/20 
splot [x1_l+my_val:x1_r-my_val] [0:1] x/(xh-xl) 
unset table 

Here you can find an alternative way to create gradients

+0

谢谢。可以请你回答大胆的问题 –

+0

我需要渐变填充样式。 –