参考链接:
https://blog.csdn.net/qq_41067397/article/details/90401657
可直接查看参考链接,更详细。
1,首先是安装:
sudo apt-get install gawk
2,进行处理:
larry@larry-VirtualBox:~/repos/ns-3-allinone/ns-3.28$ gawk -f scratch/delay.awk tcp-four.tr > myDelay
3,进入gnuplot进行画图
larry@larry-VirtualBox:~/repos/ns-3-allinone/ns-3.28$ gnuplot
G N U P L O T
Version 5.0 patchlevel 3 last modified 2016-02-21
Copyright (C) 1986-1993, 1998, 2004, 2007-2016
Thomas Williams, Colin Kelley and many others
gnuplot home: http://www.gnuplot.info
faq, bugs, etc: type "help FAQ"
immediate help: type "help" (plot window: hit 'h')
Terminal type set to 'qt'
gnuplot> set terminal png size 640,480
Terminal type set to 'png'
Options are 'nocrop enhanced size 640,480 font "/usr/share/fonts/truetype/liberation/LiberationSans-Regular.ttf,12" '
gnuplot> set xlabel "time/s"
gnuplot> set ylabel "delay/s"
gnuplot> set output "tcp-4-delay.png"
gnuplot> plot "myDelay" using 1:2 title "delay" with linespoints pointtype 2