define N 1200 set x=1,$N # dummy call to get ws dimensioned right get_hist x v ws -.5 .5 .02 set ws=ws*0 erase window 1 1 1 1 set y=x*0 limits 0 $N -.7 0.7 box ptype 1 1 # generate a lot of points to uniformly cover -0.5 to 0.5 # -and- at the same time do averages of 10 samples => pseudo-gaussian do i=1,10 { set t=random($N)-0.5 set y=y+t # keep plotting the uniform points points x t get_hist t v w -.5 .5 .02 set ws=ws+w } echo * Uniformly Distributed between -0.5 and 0.5 * toplabel * Uniformly Distributed between -0.5 and 0.5 * # use call to "cursor" in order to pause # cursor # prepare and plot the pseudo gaussian points set y=.02+y/10 lweight 3 ctype red connect x y ctype default lweight 1 define ave (sum(y)/$N) define rms (sqrt(sum(y*y)/$N)) define err ($rms/sqrt($N)) echo rms=sigma= $rms echo average= $ave +- $err echo echo * red: averages of 10 random points * # print noise_file { y } # cursor erase ctype default limits x y box connect x y set s=abs(x-450)<40?.06:0 ctype red # cursor lweight 3 connect x s lweight 1 set ynew=y ctype 0 # cursor erase box limits x ynew erase box connect x ynew stats ynew ave sig kur echo ... echo stats ynew ave sig kur echo ave=$ave sigma=$sig echo ... echo vecminmax ynew mn mx vecminmax ynew mn mx echo min=$mn max=$mx echo # print data.2 {ynew}