Pergunta

I'm comparing the throughput of wireless link in two situations, i want to plot them both in a single graph. the problem is that the graph obtained by plotting throughput against time is as in this picture

first graph

when i plot both throughputs in the same graph i obtain something as in this second picture second graph it is not clear to differentiate between the two.

I've used this code below for plotting a single throughput graph

#!/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

below is the code which i have used for plotting both graphs

#!/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"

output looks like this: enter image description here

Foi útil?

Solução

As a general remark first: Use the pngcairo terminal which provides much better antialiasing.

For processing of your data you can use different smoothing options, like smooth csplines, smooth bezier or similar (see e.g. help smooth in the interactive gnuplot terminal):

plot "1" using 1:2 smooth csplines, "2" using 1:2 smooth csplines

Which smoothing variant you use depend again on the meaning of your data.

What could also help, is to use other point types then the default ones, e.g. pt 1 for the first and pt 7 for the second one, see Gnuplot line types for the use of the test command to check the available point types.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top