2016-11-14 61 views
1

我現在畫一個螺旋線在gnuplot的腳本的幾個問題。現在我想在另一個螺旋線內畫出第二個螺旋線,公式如下:splot [t = -1.5 * pi:6 * pi] sin(t),cos(t),t * 0.23246067325畫兩條splots在一個gnuplot的

但是,如果我只是將命令添加到腳本中,似乎不起作用。有沒有特定的方法來做到這一點?

reset 
clear 
set parametric 
unset key 
unset tics 
unset border 

set termoption dashed 
set termoption dashlength 2 

set object rectangle from screen 0,0 to screen 1,1 behind fillcolor rgb 'white' fillstyle solid noborder 

set style line 4 lc rgb 'black' pt 7 
set style line 7 lc rgb 'royalblue' pt 7 ps 10 

splot [t=-1.5*pi:6*pi] sin(t),cos(t),t*0.23246067325 ls 4, '-' w p ls 7, '-' w p ls 7 
0.0 1.0 2.9211869733608857 #G# 
e 
-1.0 0.0 4.016632088371217 #E# 
e 

回答

2

變量t用於2D圖。對於3d圖(splot),請改爲使用uv

看來你只需要u,所以我刪了你的「[t=-1.5*pi:6*pi]」,並代之以由set urange [-1.5*pi:6*pi]進入splot命令之前:

(您只指定一個螺旋,讓我攀登的第一個一點點地產生第二個和所述set termoption dashlength 2並沒有爲我工作,所以我刪除它)

reset 
clear 
set parametric 
unset key 
unset tics 
unset border 

set object rectangle from screen 0,0 to screen 1,1 behind fillcolor rgb 'white' fillstyle solid noborder 

set style line 4 lc rgb 'black' pt 7 
set style line 7 lc rgb 'royalblue' pt 7 ps 10 

set urange [-1.5*pi:6*pi] 

splot sin(u), cos(u), u*0.23246067325 ls 4 ,\ 
     0.8*sin(u), 0.8*cos(u), u*0.23246067325 ls 1 ,\ 
     '-' w p ls 7, \ 
     '-' w p ls 7 
0.0 1.0 2.9211869733608857 #G# 
e 
-1.0 0.0 4.016632088371217 #E# 
e 

這將生成以下的輸出:。

enter image description here