如何在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.
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必须保存四个数据值,这些数据值存储在back1
至back4
中.对于每个新值,已存储的值均用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.