我正在尝试分析多个 tcp 拥塞控制算法并为此尝试绘制多个图,但我无法制作一个比较图。
这是我的脚本代码:
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
但是这个脚本将图分为两个子部分(两者都不是起源于原点)
谢谢
最佳答案
按照 Miguel 的建议,这里是您应该尝试的方法(记住以 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
关于使用 gnuplot 绘制多图的 Shell 脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36667170/