2016-04-16 58 views
2

我想分析多個tcp擁塞控制算法,並試圖繪製多個圖,但我無法做出一個比較圖。使用gnuplot繪製多個圖的shell腳本

這是我的腳本代碼:

gnuplot -persist <<"EOF" 
set xlabel "time (seconds)" 
set ylabel "Segments (cwnd, ssthresh)" 
plot "./cubic.out" using 1:7 title "snd_cwnd cubic", \ 
"./cubic.out" using 1:($8>=2147483647 ? 0 : $8) title "snd_ssthresh cubic",/ 
    "./reno.out" using 1:7 title "snd_cwnd reno", \ 
    "./reno.out" using 1:($8>=2147483647 ? 0 : $8) title "snd_ssthresh reno" 
    ,/ 
EOF 

但這個腳本劃分圖分成兩個子部分(均未在原點始發)

感謝

+2

可以請您提供一張圖片或數據,並更好地解釋您將實現 – bibi

+0

和一些示例數據 – Thor

+2

正斜槓使您的代碼不正確。連續換行符需要反斜槓。 – Miguel

回答

1

繼米格爾的建議,這裏是你應該嘗試(記得有EOF開始行,任何空間之前,它會使它不相關):

gnuplot -persist <<"EOF" 
set xlabel "time (seconds)" 
set ylabel "Segments (cwnd, ssthresh)" 
plot "./cubic.out" using 1:7 title "snd_cwnd cubic", \ 
"./cubic.out" using 1:($8>=2147483647 ? 0 : $8) title "snd_ssthresh cubic", \ 
    "./reno.out" using 1:7 title "snd_cwnd reno", \ 
    "./reno.out" using 1:($8>=2147483647 ? 0 : $8) title "snd_ssthresh reno" , \ 
EOF