File: smooth.dem

package info (click to toggle)
gnuplot 4.6.0-8
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 16,920 kB
  • sloc: ansic: 84,661; cpp: 6,631; lisp: 5,013; makefile: 2,129; sh: 1,092; objc: 647; asm: 539; perl: 298; awk: 235; pascal: 194; csh: 179; tcl: 88; python: 46
file content (45 lines) | stat: -rw-r--r-- 1,247 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
bin(x, s) = s*int(x/s)

set zeroaxis

# Uniform
set title "Uniform Distribution"
set key top right
set boxwidth 0.05
plot [-0.1:1.1][-0.4:1.5] "random-points" u 1:(0.25*rand(0)-.35) t '', \
     "" u (bin($1,0.05)):(20/300.) s f t 'smooth frequency' w boxes, \
     "" u 1:(1/300.) s cumul t 'smooth cumulative'
pause -1 "Hit enter to continue"


# Normal
set title "Normal Distribution"
set key top left
set boxwidth 0.05
plot "random-points" u 2:(0.25*rand(0)-.35) t '', \
     "" u (bin($2,0.05)):(20/300.) s f t 'smooth frequency' w boxes, \
     "" u 2:(1/300.) s cumul t 'smooth cumulative'
pause -1 "Hit enter to continue"


# Lognormal
set title "Lognormal Distribution"
set key top right
set boxwidth 0.1
plot [0:] "random-points" u 3:(0.25*rand(0)-.35) t '', \
    "" u (bin($3,0.1)):(10/300.) s f t 'smooth frequency' w boxes, \
    "" u 3:(1/300.) s cumul t 'smooth cumulative'
pause -1 "Hit enter to continue"


# Mixed
set title "Mixed Distribution (Lognormal with shifted Gaussian)"
set key top right
set boxwidth 0.1
plot "random-points" u 4:(0.25*rand(0)-.35) t '', \
     "" u (bin($4,0.1)):(10/300.) s f t 'smooth frequency' w boxes, \
     "" u 4:(1/300.) s cumul t 'smooth cumulative'
pause -1 "Hit enter to continue"


reset