【问题标题】:Invalid command using stats in gnuplot在 gnuplot 中使用统计信息的命令无效
【发布时间】:2014-02-21 03:44:06
【问题描述】:

所以我对 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

感谢您提供的任何帮助!

【问题讨论】:

    标签: statistics gnuplot invalid-argument


    【解决方案1】:

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

    plot 'file.dat' using 1
    show variables all
    

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

    plot 'file.dat' using 1
    # do something with GPVAL_*
    replot
    

    【讨论】:

    • 已解决。 Mint 软件管理器给了我 4.4 版。安装的 4.6 版和统计数据现在工作得很好。谢谢!
    • 另外,GPVAL_* 是一个不错的选择,感谢您的建议,但我没有得到我希望的所有功能。统计数据似乎提供了这一点。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-11-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多