2012-10-11 86 views
2

在gnuplot的,我画一个图如下图所示:gnuplot的,图线颜色

gnuplot> set title "Performance analysis" font ", 16" 
gnuplot> set xlabel "Array size" font ", 14" 
gnuplot> set ylabel "Time, milliseconds" font ", 14" 
gnuplot> set xrange [0:25] 
gnuplot> set yrange [0:6300] 
gnuplot> set xtics (5, 9, 11, 13, 15, 17, 19, 21, 23) 
gnuplot> set ytics (88, 296, 433, 835, 1067, 1516, 2592, 3920, 6214) 
gnuplot> set style line 1 linecolor rgb "blue" 
gnuplot> plot "file.dat" using 1:2 title "Graph" with lines 

它是好的,但我的图形的线条颜色仍然是红色的(默认),请你帮我设置它到蓝色。

回答

6

您缺少plot命令的一个参数;尝试

plot "file.dat" using 1:2 title "Graph" with lines ls 1 

ls 1告诉GNUPLOT使用线型1.如果您没有指定的线条样式,它只是通过它的默认值周期。虽然你在这里,你可以设置

set style data lines 

绘图之前。这样gnuplot将用线条绘制数据,并且不必在每个绘图命令中指定它。但是,如果您只绘制一条线,则可以通过一条命令完成:

plot "file.dat" using 1:2 title "Graph" with lines lc rgb 'blue'