2016-01-13 69 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

我需要漸變填充樣式。 –