Shell 使用 gnuplot 绘制多图的脚本
Shell script for ploting multiple graph using gnuplot
我正在尝试分析多个 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:(>=2147483647 ? 0 : ) title "snd_ssthresh cubic",/
"./reno.out" using 1:7 title "snd_cwnd reno", \
"./reno.out" using 1:(>=2147483647 ? 0 : ) title "snd_ssthresh reno"
,/
EOF
但是这个脚本将图表分成两个子部分(都不是起源于原点)
谢谢
听从 Miguel 的建议,这是您应该尝试的方法(记住以 EOF
开头,任何 space 之前它都会变得无关紧要):
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:(>=2147483647 ? 0 : ) title "snd_ssthresh cubic", \
"./reno.out" using 1:7 title "snd_cwnd reno", \
"./reno.out" using 1:(>=2147483647 ? 0 : ) title "snd_ssthresh reno" , \
EOF
我正在尝试分析多个 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:(>=2147483647 ? 0 : ) title "snd_ssthresh cubic",/
"./reno.out" using 1:7 title "snd_cwnd reno", \
"./reno.out" using 1:(>=2147483647 ? 0 : ) title "snd_ssthresh reno"
,/
EOF
但是这个脚本将图表分成两个子部分(都不是起源于原点)
谢谢
听从 Miguel 的建议,这是您应该尝试的方法(记住以 EOF
开头,任何 space 之前它都会变得无关紧要):
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:(>=2147483647 ? 0 : ) title "snd_ssthresh cubic", \
"./reno.out" using 1:7 title "snd_cwnd reno", \
"./reno.out" using 1:(>=2147483647 ? 0 : ) title "snd_ssthresh reno" , \
EOF