I would like to get a plot like this
which is generated in Gnuplot but plotting from a file.
The Gnuplot scrip that contains all the functions is the following:
set encoding iso_8859_1
set key right top font "Helvetica,17"
set ylabel "Received power, P_t (dBm)" font "Helvetica,18"
set xlabel "Separation distance, r (m)" font "Helvetica,18"
set xtics font "Helvetica,16"
set ytics font "Helvetica,16"
set size 1, 1.2
set terminal postscript color eps enhanced
set grid xtics ytics
set key spacing 1.5
set key box linestyle 1 width 3
set logscale x
set grid xtics mxtics
set output "link-up-test.eps"
h1=1.85
h2=0.5
r(x) = sqrt((h1 - h2)**2 + x**2 )
lmb = 300/865.7
H(x) = sqrt( 1- (4*h1*h2)/(x**2 + (h1 + h2)**2 ) )
theta(x) = 2*pi/lmb*( sqrt((h1 + h2)**2+x**2 ) - sqrt((h1 - h2)**2+ x**2) )
q_e(x) = H(x)**2*(sin(theta(x)))**2 + (1 - H(x)*cos(theta(x)))**2
P_x_G = 4
sigma = 1.94
invsqrt2pi = 0.398942280401433
normal(x,mu,sigma)=sigma<=0?1/0:invsqrt2pi/sigma*exp(-0.5*((x-mu)/sigma)**2)
rnd(x) = 10**(-normal(x,0,sigma)/10)
pot_t(x) = 10*log10( 1000*(P_x_G*1.622*((300/lmb)**2) *0.5*1) / (((4*pi*r(x))**2) *1.2*1)*q_e(x)*rnd(x) )
plot [1:12][] pot_t(x) t "up" w lines ls 1
With this script, I get the following plot
which is has similar form but it does not have the randomness os the function rnd(x) and it does not have the same levels in the y-axis.
I am missing something but I have checked several times the functions several times. I would like to know why is not the same figure.
Regards


