gnuplot:三维绘制电磁波函数

gnuplot:三维绘制电磁波函数,gnuplot,Gnuplot,有可能用gnuplot做到这一点吗?类似于此图像上的内容(链接) 我似乎无法单独设置x=sin(y)和z=sin(y)。寻求帮助 谢谢大家! 是的!你很幸运,我上周就知道了。下面是我使用的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

有可能用gnuplot做到这一点吗?类似于此图像上的内容(链接)

我似乎无法单独设置x=sin(y)和z=sin(y)。寻求帮助


谢谢大家!

是的!你很幸运,我上周就知道了。下面是我使用的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
和更多箭头来重现您的示例。

您也可以通过以下参数定义曲线:

set parametric
splot u,0,sin(u) title 'E',\
      u,-sin(u),0 title 'B'
请注意,这里的
u
不是您经常看到的
使用的缩写
u
是gnuplot在参数“s”绘图中使用的虚拟变量