gnuplot - 如何在 gnuplot 中创建 3d 相空间图?

标签 gnuplot

看这篇文章 Enclosed, but not Encrypted .

我有一些二进制数据。我想执行那篇文章中显示的 gnuplots,但使用我的数据。

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 图。

我在 gnuplot 中输入什么来实现这一点?

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

最佳答案

要绘制 3d 相空间,请使用以下脚本,其工作方式类似于 running average example从 gnuplot 页面:

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 创建了一个无效的数据点)。

要测试它,请使用此文件 randomdata.dat :
21
15
10
6
3
1
0

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

如果您有一个二进制数据文件,例如16 位数字,使用
splot 'binaryfile' binary format="%ushort" using (shift($1), samples(back4-back3)):(samples(back3-back2)):(samples(back2-back1))

如果您需要更改数据大小,请调用 gnuplot并输入 show datafile binary datasizes查看支持哪些格式。

关于gnuplot - 如何在 gnuplot 中创建 3d 相空间图?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17892901/

相关文章:

perl - 无法可视化 Chart::Gnuplot 图例中的点

python - Gnuplot:每行输入值绘制一个系列

gnuplot - gnuplot中的短虚线长度

gnuplot - 在 x 轴上定位标签

plot - 删除 gnuplot 自动标题键标签中的文件路径,只留下文件名

linux - gnuplot 读取 unix 时间戳

Gnuplot - 使用直方图样式时如何将 y 值放在条上方?

matlab - 添加带有 2 个 y 轴标签的 x 轴标签

gnuplot - gnuplot 中有 in prod() 运算符吗?

c++ - 使用 GNU Plot 绘制复杂函数