我正在比较无线链路在两种情况下的吞吐量,我想把它们都画成一个图。问题在于,通过绘制吞吐量与时间的关系所得到的图如图中所示。

当我在同一张图中绘制两个吞吐量时,我获得了第二张图片中的内容。

it is not clear to differentiate between the two. 下面的代码用于绘制单个吞吐量图
#!/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"输出如下:

发布于 2014-04-27 18:05:55
首先要注意的是:使用pngcairo终端,它提供了更好的抗混叠。
为了处理您的数据,您可以使用不同的平滑选项,如smooth csplines、smooth bezier或类似的(参见交互式gnu图终端中的help smooth ):
plot "1" using 1:2 smooth csplines, "2" using 1:2 smooth csplines您使用的平滑变量又取决于数据的含义。
还可以帮助的是使用其他点类型,然后使用默认的点类型,例如,第一个点类型是pt 1,第二个点类型是pt 7,使用test命令检查可用的点类型,请参见Gnuplot line types。
https://stackoverflow.com/questions/23326538
复制相似问题