RATHORE RATHORE - 7 months ago 46
Bash Question

Shell script for ploting multiple graph using gnuplot

I am trying to analyze multiple tcp congestion control algorithm and for that trying to plot multiple graph but i am not able to make one comparative graph.

This is my script code:

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


But this script divides graph into two sub-section( both are not originating at origin)

Thanks

Answer

Following Miguel advice, here is what you should try (remember to have EOF starting the line, any space before it would make it irrelevant):

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