使用 gnuplot 绘制多图的 Shell 脚本

标签 shell tcp 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:($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/

相关文章:

macos - `command echo` 没有 't seem to respect the ` echo` 参数

linux - 远程服务支持在 PCI 扫描中使用中等强度的 SSL 密码错误

c - C 中的 TCP 服务器 - 端口总是在增加?

gnuplot 箭头坐标 (x,y) 错误列

linux - busybox网络配置脚本错误

linux - 从文件添加 iptable 规则

networking - UDP vs TCP,它快多少?

GnuPlot 未在整个范围内绘制

Gnuplot:特定位置的垂直线

shell - 意外地用 sed 替换 &