【发布时间】:2014-05-02 16:38:51
【问题描述】:
我有一个数据文件,例如 dat.txt
0 3111 1755 2577 1895 3224 1725 2163 1641 2525 331
它只有一行数据,出于某种原因,我想将它们绘制为每个值的垂直框,而不是一条连接所有数据点的线。
请问我如何使用 Gnuplot 做到这一点,我认为我为 gnuplot 使用的版本是 4.2.6
【问题讨论】:
标签: gnuplot histogram graphing
我有一个数据文件,例如 dat.txt
0 3111 1755 2577 1895 3224 1725 2163 1641 2525 331
它只有一行数据,出于某种原因,我想将它们绘制为每个值的垂直框,而不是一条连接所有数据点的线。
请问我如何使用 Gnuplot 做到这一点,我认为我为 gnuplot 使用的版本是 4.2.6
【问题讨论】:
标签: gnuplot histogram graphing
help boxes 或在文档中搜索框呢?因此,对于框,请使用 boxes 绘图样式。
在任何情况下,您都必须将数据组织成列而不是单行。在 *nix 上,您可以使用 tr 即时执行此操作:
set style fill solid
set boxwidth 0.9
plot '< tr " " "\n" < dat.txt' with boxes
4.2.6 版本的输出是:
【讨论】:
plot '< tr " " "\n" < dat.txt' with boxes lc rgb '#aaaaaa'