1

所以我对 gnuplot 还很陌生,当我尝试在 gnuplot 中的文件上使用统计信息时,我遇到了一个无效的命令错误。

有问题的命令:

gnuplot> stats "file.dat" using 1
stats "file.dat" using 1
         ^
         invalid command

该文件与 plot 命令一起工作得很好,如下所示:

gnuplot> plot "file.dat" using 1 with lines
plot "file.dat" using 1 with lines

数据文件 file.dat 如下所示:

125.48  262.31
0.85    215.18
0.85    175.29
0.85    132.11
0.85    78.72
0.74    33.92
0.74    15.98
0.28    9.63
0.28    7.28
0.28    6.24
0.10    5.76
0.10    5.08
0.01    5.02
0.01    4.93
0.01    4.77

谢谢你尽你所能的帮助!

4

1 回答 1

1

stats命令仅从版本 4.6.0 开始可用。在以前的版本中,只有在绘图之后才能访问一些数据信息。这包括例如确切的数据范围,可通过变量GPVAL_DATA_X_MIN等获得GPVAL_DATA_X_MAX。使用

plot 'file.dat' using 1
show variables all

查看可用的变量。然后你可以做类似的事情

plot 'file.dat' using 1
# do something with GPVAL_*
replot
于 2014-02-20T19:44:06.293 回答