Back to demo index

gnuplot demo script: smooth.dem

autogenerated by webify.pl on Sat Oct 1 21:49:30 2022
gnuplot version gnuplot 5.4 patchlevel 5
Your browser does not support the HTML 5 canvas element
          # unzoom rezoom zoom text ?
     
#
# Find number of points
#
stats 'random-points' nooutput
N = STATS_records

bin(x, s) = s*int(x/s)

set zeroaxis
set style data points
set key box top left

# Uniform
set title "Uniform Distribution"
set boxwidth 0.05
set xrange [-0.1 : 1.1] noextend
set yrange [-0.4 : 1.6]
plot "random-points" u 1:(0.25*rand(0)-.35) t '', \
     "" u (bin($1,0.05)):(20./N) smooth freq t 'smooth frequency' w boxes, \
     "" u 1:(1.) smooth cnorm t 'smooth cnorm'

Click here for minimal script to generate this plot


Your browser does not support the HTML 5 canvas element
          # unzoom rezoom zoom text ?
     


# Normal
set title "Normal Distribution"
set boxwidth 0.05
set xrange [* : *] noextend
set yrange [-0.4 : 1.1]
set ytics 0,.2

plot "random-points" u 2:(0.25*rand(0)-.35) t '', \
     "" u (bin($2,0.05)):(20./N) smooth freq t 'smooth frequency' w boxes, \
     "" u 2:(1.) smooth cnorm t 'smooth cnorm'

Click here for minimal script to generate this plot


Your browser does not support the HTML 5 canvas element
          # unzoom rezoom zoom text ?
     


# Lognormal
set title "Lognormal Distribution"
set boxwidth 0.1
set xrange [0 : *] noextend
plot "random-points" u 3:(0.25*rand(0)-.35) t '', \
    "" u (bin($3,0.1)):(10./N) smooth freq t 'smooth frequency' w boxes, \
    "" u 3:(1.) smooth cnorm t 'smooth cnorm'

Click here for minimal script to generate this plot


Your browser does not support the HTML 5 canvas element
          # unzoom rezoom zoom text ?
     


# Mixed
set title "Mixed Distribution (Lognormal with shifted Gaussian)"
set boxwidth 0.1
set xrange [* : *] noextend
set link y2 via y*N inverse y/N
set ytics nomirror  0,.2
set y2tics nomirror tc "red" 0,50

plot "random-points" u 4:(0.25*rand(0)-.35) t '', \
     "" u (bin($4,0.1)):(10./N) smooth freq t 'smooth frequency' w boxes, \
     "" u 4:(1.) smooth cnorm t 'smooth cnorm' lc "#88eeff" lw 5, \
     "" u 4:(1.) axes x1y2 smooth cumulative t 'smooth cumulative' lc "red"

Click here for minimal script to generate this plot