我正在比较两种情况下无线链路的吞吐量,我想将它们都绘制在一张图中。问题是通过绘制吞吐量随时间变化得到的图就是这张图
当我在同一张图中绘制两个吞吐量时,我得到了第二张图片中的内容 两者之间的区别尚不清楚。
我在下面使用这段代码绘制了一个吞吐量图
#!/usr/bin/gnuplot
reset
!iperf -c 192.168.1.101 -i 0.5 -t 60 > a
#this is used for deleting first 6 lines
!sed -i 1,+5d a
#used to delete last line
!sed '$d' a > cropped
!cat cropped | cut -c 7-10 > b
!cat cropped | cut -c 35-38 > c
!paste b c > d
!awk 'BEGIN{print "0.0 0.0"}{print}' d > e
set xlabel "time"
set ylabel "throughput"
set terminal png nocrop enhanced font arial 8 size 900,300
#set terminal png size 900, 300
set output "chart_1.png"
#table name below graph(naming curve by colour)
set key below
plot 'e' using 1:2 title "Throughput Performance" with lines
下面是我用来绘制两个图的代码
#!/usr/bin/gnuplot
reset
set xlabel "time"
set ylabel "throughput"
set terminal png nocrop enhanced font arial 8 size 900,300
#set terminal png size 900, 300
set output "chart_1.png"
#table name below graph(naming curve by colour)
set key below
set style data linespoints
plot "1" using 1:2 title "case1", \
"2" using 1:2 title "case2"
输出如下所示:
最佳答案
首先作为一般性评论:使用提供更好抗锯齿的 pngcairo
终端。
为了处理您的数据,您可以使用不同的平滑选项,例如 smooth csplines
、smooth bezier
或类似的(参见例如 help smooth
交互式 gnuplot 终端):
plot "1" using 1:2 smooth csplines, "2" using 1:2 smooth csplines
您使用哪种平滑变体再次取决于您的数据的含义。
还有什么可以帮助的是使用其他点类型然后使用默认点类型,例如pt 1
用于第一个,pt 7
用于第二个,参见 Gnuplot line types使用 test
命令检查可用的点类型。
关于linux - gnuplot 中吞吐量的明显差异,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23326538/