gnuplot中的幻影箭头?

时间:2013-12-24 22:13:30

标签: gnuplot

代码

set term postscript eps enhanced color
set output "C:\\Users\\cole1\\Desktop\\gnuplot_w3.eps"
set multiplot
set isosamples 140
unset key
set title "r"
set xrange [-6:6]
set yrange [-6:6]
set zrange [-4:4]
set zlabel "Energy" 
set label "(arbitrary units)" at 0.001,40
set hidden3d nooffset
set style arrow 1 lw 2 head filled size 0.1,20,70
unset key
set ztics 1
set view 69,120 #Done implicitly by mousing.
set arrow 1 nohead from 0,0,0 to 0,0,4.0 as 1 back
# set arrow 2 nohead from 0,0,0 to 0,4.5,-1 as 1 back
# set arrow 3 nohead from 0,0,0 to 4.5,0,0 as 1 back
splot (x**2+y**2+1)**(0.5),-(x**2+y**2+1)**(0.5)
# set arrow 4 nohead from 0,0,2.5 to 0,0,4.0 as 1 front
unset xtics 
unset ytics 
unset ztics  
set parametric
set samples 1000
plot 0.06*sin(25*t)-1,0.06*cos(25*t)-0.5 lw 1 lc rgb "green"
plot 0.012*sin(25*t)-1.045,0.02*cos(25*t)+2.465 lw 3 lc rgb "green"
unset xtics 
unset ytics 
unset multiplot

在最终结果中只生成一个箭头。但是,取消注释该注释掉的代码中的第一行(将箭头2从0,0,0设置为0,4.5,将-1设置为1),会导致出现两个新箭头。第二个箭头来自哪里,如何避免这种现象?

1 个答案:

答案 0 :(得分:2)

set arrow适用于以下所有[s]plot命令。 arrow 1不再出现,因为它具有相同的x和y值,因此问题仅出现在第二个箭头上。在unset arrow之后添加splot以避免此问题。

您还应unset title,或使用set multiplot title 'r'代替。另请注意,plot的边距与第一个splot的边距不一致。