确定gnuplot中的最小值和最大值

确定gnuplot中的最小值和最大值,gnuplot,max,min,Gnuplot,Max,Min,我是gnuplot的新手,我试图从数据文件中确定mina和max,然后绘制数据 到目前为止,我已成功确定最小值和最大值,如下所示: # Define two helper functions ismin(x) = (x<min)?min=x:0 ismax(x) = (x>max)?max=x:0 # Initialise the 'global' vars max=-1e38 min=1e38 plot "Data.txt" u 0:(ismin($3)*ismax($3))

我是gnuplot的新手,我试图从数据文件中确定mina和max,然后绘制数据

到目前为止,我已成功确定最小值和最大值,如下所示:

# Define two helper functions
ismin(x) = (x<min)?min=x:0
ismax(x) = (x>max)?max=x:0

# Initialise the 'global' vars
max=-1e38
min=1e38

plot "Data.txt" u 0:(ismin($3)*ismax($3))
如果删除与确定最小值和最大值相关的零件,splot命令将起作用


有什么建议吗?

查看
stats
命令:

stats 'datafile' using 3
例如,将获取第三列(z数据)的统计信息,并将其存储在变量中(
STATS\u min
STATS\u max
可能是您想要的)。要查看创建的所有变量,请键入

show variables all

运行
stats
后。如果您有一个没有
stats
的较旧版本的gnuplot,您可以在不创建输出的情况下打印文件,并且gnuplot自动定义一些
数据
-前缀变量,包括最小值/最大值。
stats
命令省去了在打印前定义空输出以获取数据的麻烦。

。。谢谢我在找这个。。Gnuplot 4.6添加了一些非常棒的特性…可能与
show variables all