如何在gnuplot中创建3d相空间图? [英] How do I create a 3d phase-space plot in gnuplot?

查看:60
本文介绍了如何在gnuplot中创建3d相空间图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请参阅本文已封闭但未加密.

我有一些二进制数据.我想执行该文章中显示的gnuplot,但是要使用我的数据.

I have some binary data. I want to perform the gnuplots shown in that article, but using my data.

对于三维相空间图,序列a,b,c,d,e, f等可用作空间坐标(a-b,b-c,c-d),(b-c,c-d, d-e),(c-d,d-e,e-f)等.创建的图中的模式显示 后续序列之间的重复关系.在这个相图中, 50,000个16位随机数将产生一个非结构化的云 点.

For a three-dimensional phase-space plot, the sequence a, b, c, d, e, f, etc. can be used as space coordinates (a-b, b-c, c-d), (b-c, c-d, d-e), (c-d, d-e, e-f), etc. Patterns in the plot created reveal recurring relations between subsequent sequences. In this phase plot, 50,000 16-bit random numbers would produce an unstructured cloud of dots.

我想做完全一样的事情.我有一个二进制文件(大约10 MB),我想通过gnuplot运行它来创建漂亮的gnuplot图.

I want to do exactly the same kind of thing. I have a binary file (about 10 MB) and I'd like to run it through gnuplot to create the nice gnuplot graphs.

我要在gnuplot中键入什么来实现这一目标?

What do I type into gnuplot to make that happen?

用Google搜索相空间图"和gnuplot并不会返回太多.我不知道这是否是因为这篇文章是德语的翻译.我认为我没有在堆栈交换站点中找到相关的答案.

Doing a Google search for "phase space plot" and gnuplot doesn't return much. I don't know if that's because the article is a translation from German. I don't think I've found relevant answers in stack exchange sites.

推荐答案

要绘制3d相空间,请使用以下脚本,该脚本的作用类似于

To plot the 3d phase space use the following script, which works like the running average example from the gnuplot page:

reset
back4 = back3 = back2 = back1 = 0
shift(x) = (back4 = back3, back3 = back2, back2 = back1, back1 = x)
samples(x) = $0 < 3 ? NaN : x
set ticslevel 0
# the labels are only for orientation when checking the test data
set xlabel 'xlabel'
set ylabel 'ylabel'
splot 'randomdata.dat' using (shift($1), samples(back4-back3)):(samples(back3-back2)):(samples(back2-back1))

Gnuplot必须保存四个数据值,这些数据值存储在back1back4中.对于每个新值,已存储的值均用shift进行移位. samples注意不要使用前三个值,而只存储它们(NaN创建一个无效的数据点).

Gnuplot must hold four data values, which are stored in back1 to back4. For every new value, the stored values are shifted with shift. samples takes care that the first three values are not used, but only stored (NaN creates an invalid data point).

要对其进行测试,请使用以下文件randomdata.dat:

To test it, use this file randomdata.dat:

21
15
10
6
3
1
0

这将在(6,5,4),(5,4,3),(4、3、2)和(3,2,1)处绘制四个数据点.

This plots four data points at (6,5,4), (5,4,3), (4,3,2), and (3,2,1).

如果您有一个二进制数据文件,例如16位数字,请使用

If you have a binary data file with e.g. 16bit numbers, use

splot 'binaryfile' binary format="%ushort" using (shift($1), samples(back4-back3)):(samples(back3-back2)):(samples(back2-back1))

如果需要更改数据大小,请调用gnuplot并键入show datafile binary datasizes以查看支持的格式.

If you need to change the datasize, invoke gnuplot and type show datafile binary datasizes to see which formats are supported.

这篇关于如何在gnuplot中创建3d相空间图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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