无法使用gnuplot绘制条形图

无法使用gnuplot绘制条形图,gnuplot,Gnuplot,在使用gnuplot绘制条形图时,我发现了一个问题。我在Windows7上使用gnuplot版本4.6。我看到一条错误消息;预料之中 逻辑如下: # bar graph #set title "Programming language" set xlabel "Programming" set ylabel "Execution time" set auto x set yrange [0:120] set style data histogram set style histogram clu

在使用gnuplot绘制条形图时,我发现了一个问题。我在Windows7上使用gnuplot版本4.6。我看到一条错误消息;预料之中

逻辑如下:

# bar graph
#set title "Programming language"
set xlabel "Programming"
set ylabel "Execution time"
set auto x
set yrange [0:120]
set style data histogram
set style histogram cluster gap 1
set style fill solid border -1
set boxwidth 0.9
set xtic scale 0
plot 'bar-graph.dat' using 2:xtic(1) title "Python" col fc rgb "#4671d5", '' u 3 title "Java" col fc rgb "#ff0000", '' u 4 title "C++" col fc rgb "#f36e00"
                                                                                                                              ^
         ';' expected
以下是数据:

"Python"         50   70     66.5
"Java"           30   50     48
"C++"            10   20    14.8
我想绘制一个类似于MicrosoftExcel的连接条形图。请让我知道我错过了什么

谢谢,
Anand

您使用了错误的语法来设置线条颜色。没有选择。只需使用lc rgb 467165:

请给你的图贴上更有意义的标签。拥有一个带有“python”条的“python”组并不是自我解释的

plot 'bar-graph.dat' using 2:xtic(1) title "Python" lc rgb "#4671d5", '' u 3 title "Java" lc rgb "#ff0000", '' u 4 title "C++" lc rgb "#f36e00"