首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >gnuplot : 3d绘制电磁波函数

gnuplot : 3d绘制电磁波函数
EN

Stack Overflow用户
提问于 2013-04-03 04:21:58
回答 2查看 1.2K关注 0票数 0

使用gnuplot可以做到这一点吗?如下图所示(链接)

http://i.stack.imgur.com/mZ3M0.gif

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

谢谢!

EN

回答 2

Stack Overflow用户

发布于 2013-04-03 06:56:15

是!你走运了,我上周就知道了。下面是我使用的gnuplot代码:

代码语言:javascript
运行
复制
#!/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和更多箭头来重现您的示例。

票数 0
EN

Stack Overflow用户

发布于 2013-04-03 10:05:32

也可以像这样参数化地定义曲线:

代码语言:javascript
运行
复制
set parametric
splot u,0,sin(u) title 'E',\
      u,-sin(u),0 title 'B'

请注意,这里的u并不是您经常看到的using的缩写。u是gnuplot在参数化“s”绘图中使用的一个虚拟变量。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15773632

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档