【问题标题】:How to plot a graph with linux?如何用linux绘制图形?
【发布时间】:2014-12-31 21:11:11
【问题描述】:

我想在 Linux 中绘制一个数据文件 (speed11.data)。 数据文件看起来像:

1,4.45823517e+01
2,4.45873528e+01
3,4.45923538e+01
4,4.45973549e+01

我使用了 gnuplot,但出现错误。

 gnuplot> plot "speed11.data"


gnuplot> 1,4.45823517e+01
         ^
         "speed11.data", line 1: invalid command

如何绘制此图?

locale 的输出为:

LANG=en_CA.UTF-8
LC_CTYPE="en_CA.UTF-8"
LC_NUMERIC="en_CA.UTF-8"
LC_TIME="en_CA.UTF-8"
LC_COLLATE="en_CA.UTF-8"
LC_MONETARY="en_CA.UTF-8"
LC_MESSAGES="en_CA.UTF-8"
LC_PAPER="en_CA.UTF-8"
LC_NAME="en_CA.UTF-8"
LC_ADDRESS="en_CA.UTF-8"
LC_TELEPHONE="en_CA.UTF-8"
LC_MEASUREMENT="en_CA.UTF-8"
LC_IDENTIFICATION="en_CA.UTF-8"
LC_ALL=

【问题讨论】:

  • 用空格替换逗号后对我来说效果很好。
  • 我用制表符代替了“,”,但无法绘图。 gnuplot> 1 4.45823517e+01 ^ "speed13b.data",第 1 行:无效命令
  • 我只能建议重新安装 gnuplot。
  • 另外请发布版本信息。例如:uname -a && gnuplot --version && dpkg -l | grep "^i.*gnuplot"
  • 另外请发帖gnuplot <(echo "show terminal")

标签: linux gnuplot


【解决方案1】:

对于 gnuplot,您可能需要查看处理在 gnuplot 中使用逗号分隔值 (CSV) 的 this post

或者,您可能想尝试使用R 而不是gnuplot。 R 具有导入 csv 数据文件的能力,并且能够进行一些复杂的绘图。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-03-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-03-12
    相关资源
    最近更新 更多