Gnuplot:将最后一个数据点存储为变量 [英] Gnuplot: store last data point as variable

查看:68
本文介绍了Gnuplot:将最后一个数据点存储为变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有一种简单的方法,使用Gnuplot来获取数据文件中的最后一个点,例如data.txt并将值存储在变量中.

I was wondering if there is an easy way, using Gnuplot, to get the last point in a data file say data.txt and store the values in a variable.

根据这个问题, 使用gnuplot访问数据文件中的第n个数据点 我知道我可以使用统计信息和GP_VAL_DATA_X_MAX变量获取X值,但是有一个简单的技巧来获取相应的y值吗?

From this question, accessing the nth datapoint in a datafile using gnuplot I know that I can get the X-Value using stats and GP_VAL_DATA_X_MAX variable, but is there a simple trick to get the corresponding y-value?

推荐答案

如果要使用Gnuplot,可以

If you want to use Gnuplot, you can

plot 'data.txt'
plot[GPVAL_DATA_X_MAX:] 'data.txt'
show variable GPVAL_DATA_Y_MAX

OR

plot 'data.txt'
plot[GPVAL_DATA_X_MAX:] 'data.txt'
print GPVAL_DATA_Y_MAX

这篇关于Gnuplot:将最后一个数据点存储为变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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