Gnuplot - 在指定空间(例如一个盒子)内暂停绘制位置(xyz)与时间数据 [英] Gnuplot - plotting position(xyz) vs time data inside a specified space (eg a box) with a pause

查看:21
本文介绍了Gnuplot - 在指定空间(例如一个盒子)内暂停绘制位置(xyz)与时间数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下可以在gnuplot中完成吗?如果是,如何?

我在一个以 t,x,y,z 作为标题的表中有时间与位置 (x,y,z) 的数据.

我想知道我是否可以以某种方式绘制粒子在预定义空间内的相同时间与位置,并在每个时间步长后暂停;这样我就可以看到粒子位置随时间的演变.我也想知道能不能从前一个位置到当前位置画一条连续的线,这样我才能真正看到它过去的轨迹.

示例数据:

假设预定义的空间是一个 10x10x10 的盒子,我的粒子在 3 秒内具有以下位置.

t x y z0 1 2 31 2 3 42 3 4 53 4 5 6

我如何看到粒子的跟踪!我的想法是,如果我可以将每个时间步的情节暂停一点,它看起来就像一个动画,我可以使用屏幕捕获软件捕获...<​​/p>

除非,这些数据也可以使用 gnuplot 进行动画处理

如果 gnuplot 不是正确的工具,是否还有其他软件可以更有效和/或更优雅地执行此操作!?

任何帮助将不胜感激!

谢谢.

解决方案

创建文件 main.gp 并运行 gnuplot main.gpload "main.gp>gnuplot shell 中的 gp".输出在 point.gif 中.文档
.

Can the following be done in gnuplot? If yes, how?

I have data for time vs position(x,y,z) in a table with t,x,y,z as headers.

I would like to know if I can somehow plot the same time vs position of the particle inside a predefined space with a pause after each time step; so that i can see the evolution of the particles position with time. I would also like to know if I can draw a continuous line from the previous position to the current position so that I can actually see the track of its past.

Example data:

Lets say the predefined space is a box of 10x10x10 and my particle has the following positions over 3 seconds.

t x y z

0 1 2 3 

1 2 3 4

2 3 4 5

3 4 5 6

How do i see the tracking of the particle! my idea is that if i can pause the plot of every time step by a little bit, it will look like an animation which i can just capture using a screen capture software...

UNLESS, this data can be animated using gnuplot too

Is there any other software which does this more efficiently and/or elegantly if gnuplot is not the right tool!?

Any help would be appreciated!

Thanks.

解决方案

Create file main.gp and run gnuplot main.gp or load "main.gp" in gnuplot shell. Output is in point.gif. Documentation
http://www.gnuplot.info/documentation.html
Also you can type help in gnuplot shell.

main.gp

set term gif animate delay 30 size 400, 400
set output "point.gif"
do for [n=1:4] {
    splot [0:7][0:7][0:7] "data" u 2:3:4 every :::::n w lp t sprintf("n=%i", n)
}

data

t x y z

0 1 2 3

1 2 3 4

2 3 4 5

3 4 5 6

EDIT: I switched to iterations as @mgilson suggested.

这篇关于Gnuplot - 在指定空间(例如一个盒子)内暂停绘制位置(xyz)与时间数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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