Back to demo index

gnuplot demo script: smooth.dem

autogenerated by webify.pl on Mon Jun 2 12:46:00 2025
gnuplot version gnuplot 6.0.3 patchlevel 3
#
# 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



# 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



# 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



# 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



AltStyle によって変換されたページ (->オリジナル) /