使用gnuplot的向量场 [英] Vector field using gnuplot

查看:91
本文介绍了使用gnuplot的向量场的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何绘制矢量场,其中每个点(x,y)的方向由tangent(alpha) = f(x, y)给出?

How do I plot a vector field, where the direction at each point (x, y) is given by tangent(alpha) = f(x, y)?

推荐答案

据我所知,gnuplot在从文件读取数据时只能绘制矢量字段.您的文件必须具有4列,即x,y,deltax和delta y,然后gnuplot将为文件中的每一行绘制一个从(x,y)到(x + deltax,y + deltay)的向量:

As far as I can tell, gnuplot can only plot vector fields when reading data from a file. Your file will have to have 4 columns, x, y, deltax and delta y, and gnuplot will then plot a vector from (x,y) to (x+deltax, y+deltay) for each line in the file:

plot "file.dat" using 1:2:3:4 with vectors head filled lt 2

如果您不坚持使用gnuplot,则可以使用其他工具更好或更轻松地实现.我个人使用渐近线.在渐近线此处中绘制了一个矢量场的示例.

If you are not insisting on using gnuplot, there are other tools that can to this better or at least easier. I personally use asymptote. There is an example of a vectorfield plotted in asymptote here.

这篇关于使用gnuplot的向量场的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆