每次使用gnuplot都要上網查一遍。很多指令記不住,尤其是輸出有顏色的eps文件的相關命令。另外,plot關於控制線條線型,顏色,粗細。Mark的形狀,大小等總是記不太清。所以,特記錄一個例子,以便日後查閱。
set term post eps color "Helvetica" 24 #輸出eps格式,而且帶顏色,另外,字體使用helvetica, 24號。
set output "thrput.eps"
set xlabel "Time (Second)"
set ylabel "Throughput (pkts/second)"
set key left top
plot "thr_node8.data" u ($1/1000):2 w lp lt 1 linecolor rgb "red" pt 2 ps 2 lw 1.5 title "App1", "thr_node4.data" u ($1/1000):2 w lp lt 1 linecolor rgb "blue" pt 4 ps 2 lw 1.5 title "App2"
#linecolor第一次使用。如果不指定的話,會有默認顏色,但是貌似是跟lt綁定的。我之前使用lt 3總是出現虛線,無法解決。所以,兩條線全部使用lt 1, 然後顏色用linecolor區分。