File: bins.dem

package info (click to toggle)
gnuplot 6.0.2%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 14,940 kB
  • sloc: ansic: 95,319; cpp: 7,590; makefile: 2,470; javascript: 2,328; sh: 1,531; lisp: 664; perl: 304; pascal: 191; tcl: 88; python: 46
file content (51 lines) | stat: -rw-r--r-- 748 bytes parent folder | download | duplicates (6)
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
46
47
48
49
50
51
#
# Demo illustrating the relationship between
# a binned histogram and a kernel density model of the same data.
#
$DATA << EOD
1	1
2	1
8	1
9	1
17	1
17	1
9	1
9	1
5	1
7	1
7	1
8	1
8	1
8	1
10	1
11	1
11	1
12	1
14	1
3	1
3	1
3	1
8	7
15	1
17	1
17	1
18	1
19	1
20	1
EOD

set title "Comparison of a binned histogram and\na kernel density model of the same data"

set style data lines
set xtics 1 norangelimit nomirror
set grid y
set yrange [0:5.5]
set style fill solid 0.5 noborder
set jitter spread 0.5

plot $DATA using 1 bins=20 with boxes title '20 bins', \
        '' using 1:(1) smooth kdensity bandwidth .5 lw 2 title 'smooth kdensity', \
        '' using 1:(.9) with impulse lc "black" title 'jittered data'
 
pause -1 "Hit return to continue"
reset