如何从列中的所有其他值中的第一行中减去值?
我想从文件的第一行减去文件的所有行,然后绘制它。如何在GNUPLOT中实施此类数学工作? 这是我想做的示例:
假设我有一个文件,该文件具有两个列和1000行。我想要一个从第一行中的第二列值中减去第二列中所有数据的脚本。
I want to subtract all rows of a file from its first row, and then plot it. How can I implement such math work in gnuplot?
Here is an example of what i want to do:
Let's say i have a file that has two columns and 1000 rows. I want a script that subtract all data's in 2nd column from the 2nd column value in first row.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我很确定关于类似的问题,因此,显然并不容易找到。
我会搜索“归一化”或“偏移”。
即使您的数据中有单个或双空行,也可以使用以下示例。图命令中的表达式使用序列评估,检查
帮助操作员二进制
。有时,您可能会使用伪综合0(检查
help pseudoColumns
)看到类似的解决方案,但是,如果数据中有空行,这可能会导致错误的结果。脚本:
结果:
I am pretty sure that there are a similar questions on SO, however, apparently not so easy to find.
I would have searched for "normalization" or "offset".
The following example works even if you have single or double empty lines in your data. The expression in the plot command uses serial evaluation, check
help operators binary
.Sometimes, you might see similar solutions using the pseudocolumn 0 (check
help pseudocolumns
), however, which might lead to wrong results if you have empty lines in your data.Script:
Result: