使用gnuplot可以做到这一点吗?如下图所示(链接)
http://i.stack.imgur.com/mZ3M0.gif
我似乎无法独立地设置x= sin(y)和z= sin(y)。寻求帮助!
谢谢!
发布于 2013-04-03 06:56:15
是!你走运了,我上周就知道了。下面是我使用的gnuplot代码:
#!/usr/bin/env gnuplot
reset
set term png lw 2
set out 'test.png'
set style data lines
# Set x,y,z ranges
set xr [0:10]
set yr [-2:2]
set zr [-2:2]
# Rotates so that plots have a nice orientation.
# To get parameters, plot in interactive terminal and use 'show view' command.
set view 45,30,1,1
set arrow from 0,0,0 to 10,0,0
unset border
unset tics
splot '+' u 1:(0):(sin($1)) t 'E', \
'+' u 1:(-sin($1)):(0) t 'B'
这是我得到的数字:
我没有标签,但您可以使用set label
和更多箭头来重现您的示例。
发布于 2013-04-03 10:05:32
也可以像这样参数化地定义曲线:
set parametric
splot u,0,sin(u) title 'E',\
u,-sin(u),0 title 'B'
请注意,这里的u
并不是您经常看到的using
的缩写。u
是gnuplot在参数化“s”绘图中使用的一个虚拟变量。
https://stackoverflow.com/questions/15773632
复制相似问题