【问题标题】:Shell script for ploting multiple graph using gnuplot使用 gnuplot 绘制多个图形的 Shell 脚本
【发布时间】:2016-04-16 17:11:18
【问题描述】:

我正在尝试分析多个 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

但是这个脚本将图形分成两个子部分(两者都不是起源于原点)

谢谢

【问题讨论】:

  • 能否请您提供图片或数据,并更好地说明您将实现的目标
  • 和一些示例数据
  • 正斜杠使您的代码不正确。连续换行符需要反斜杠。

标签: shell tcp gnuplot


【解决方案1】:

按照 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

【讨论】:

    猜你喜欢
    • 2018-05-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-12-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多