使用gnuplot绘制条形图时遇到问题。我在Windows 7上使用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
我想绘制一个类似于Microsoft Excel的连接条形图。请让我知道我想念的东西。
谢谢阿南德
您使用了错误的语法来设置线条颜色。没有col
选择。只需使用lc rgb "#467165"
:
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"
并请给您的绘图更多有意义的标签。具有“ python”栏的“ python”组并不是很容易理解。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句