gnuplot histogram:第0行:使用规范时列太多

Gre*_*ris 3 bash plot gnuplot histogram

我想创建一个包含以下内容的文件的直方图:

1 144 12.54
2 564 02.34
3 231 01.23
4 452 07.12
Run Code Online (Sandbox Code Playgroud)

我在脚本中用于此目的的是:

gnuplot << EOF
            set terminal gif
            set terminal postscript eps color enhanced
            set output "diagramma";
            set title 'Diagramma'
            set key off
            set style data histogram
            set style histogram cluster gap 1
            set style fill solid border -1
            set boxwidth 0.9
            set autoscale
            set xlabel "May"
            plot 'finalsumfile' using 1:2 with histogram, 'finalsumfile' using 1:3 with histogram

EOF
Run Code Online (Sandbox Code Playgroud)

所以我希望第一列为x坐标,第二列为第三列.

但是,当我运行我的脚本时出现此错误:

line 0: Too many columns in using specification 
Run Code Online (Sandbox Code Playgroud)

我究竟做错了什么?

mgi*_*son 6

尝试:

 plot 'finalsumfile' using 2:xticlabels(1) with histogram
Run Code Online (Sandbox Code Playgroud)

直方图通常只占用1列数据,"x值"每次从0开始隐式递增1.要设置显式x标签,您需要使用xticlabels哪个获取给定列中的字符串并将其用作标签.