File: jitter.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 (120 lines) | stat: -rw-r--r-- 3,443 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#
# jitter.dem
#

# Generate a reusable set of N random data points.
nsamp = 160
set print $random
do for [i=1:nsamp] {
    print sprintf("%8.5g %8.5g", invnorm(rand(0)), 100.*invnorm(rand(0)))
}
unset print
#

set border 2
set xrange [-1.5:1.4]
set xtics ("A" -1, "B" 0, "C" 1)
set xtics nomirror scale 0
set ytics nomirror rangelimited

set multiplot layout 1,2
unset jitter
set title "no jitter"
set style data point
plot $random using (int($1)%20):2 notitle  pt 6 ps 1.5 lc "gray"
set jitter 
set title "jitter"
plot $random using (int($1)%20):2 notitle  pt 6 ps 1.5 lc "gray"
unset multiplot

pause -1 'Hit <cr> to continue'

set linetype  9 lc "#80bb33bb"
set linetype 10 lc "#8033bbbb"
set linetype 11 lc "#80bbaa44"

set multiplot layout 1,3 title "vertical overlap criterion"
set style data point
set jitter overlap 0.5
set title "jitter overlap 0.5"
plot $random using (int($1)%20):2:(10+int($1)) notitle  pt 7 ps 1 lc var
set jitter overlap 1
set title "jitter overlap 1.0"
plot $random using (int($1)%20):2:(10+int($1)) notitle  pt 7 ps 1 lc var
set jitter overlap 1.5
set title "jitter overlap 1.5"
plot $random using (int($1)%20):2:(10+int($1)) notitle  pt 7 ps 1 lc var
unset multiplot

pause -1 'Hit <cr> to continue'

set multiplot layout 1,3 title "spread parameter scales the horizontal jitter"
set style data point
set jitter overlap 1 spread 0.4
set title "jitter spread 0.4"
plot $random using (int($1)%20):2:(10+int($1)) notitle  pt 7 ps 1 lc var
set jitter overlap 1 spread 0.7
set title "jitter spread 0.7"
plot $random using (int($1)%20):2:(10+int($1)) notitle  pt 7 ps 1 lc var
set jitter overlap 1 spread 1.0
set title "jitter spread 1.0"
plot $random using (int($1)%20):2:(10+int($1)) notitle  pt 7 ps 1 lc var
unset multiplot

pause -1 'Hit <cr> to continue'

set multiplot layout 1,3 title "Plot appearance is also affected by point size"
set style data point
set jitter overlap 0.4 spread 1
set title "pointsize 0.5"
plot $random using (int($1)%20):2:(10+int($1)) notitle  pt 7 ps 0.5 lc var
set title "pointsize 1.0"
plot $random using (int($1)%20):2:(10+int($1)) notitle  pt 7 ps 1 lc var
set title "pointsize 2.0"
plot $random using (int($1)%20):2:(10+int($1)) notitle  pt 7 ps 2 lc var
unset multiplot

pause -1 'Hit <cr> to continue'

set multiplot layout 1,2 title "Jitter style options"
set jitter over 0.5 swarm
set title "swarm (default)"
plot $random using (int($1)%20):2:(10+int($1)) notitle  pt 7 ps 1 lc var
set jitter over 0.5 square
set title "square"
plot $random using (int($1)%20):2:(10+int($1)) notitle  pt 7 ps 1 lc var
unset multiplot

pause -1 'Hit <cr> to continue'

set multiplot layout 1,3 title "Jitter style options"
set jitter
set title "no wrap"
plot $random using (int($1)%20):2:(10+int($1)) notitle  pt 7 ps 1 lc var
set jitter wrap 5
set title "wrap 5"
plot $random using (int($1)%20):2:(10+int($1)) notitle  pt 7 ps 1 lc var
set jitter wrap 3
set title "wrap 3"
plot $random using (int($1)%20):2:(10+int($1)) notitle  pt 7 ps 1 lc var
unset multiplot

pause -1 'Hit <cr> to continue'

reset

array data = [ 1, 1, 1, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 7, 7, 8, 8, 8, 8, 8, 8, 8 ]

set title "Jitter style option\nvertical"
set jitter vertical spread 0.2

set xrange [0:9]
set yrange [0:2]
set ytics ("1.0" 1.0) nomirror
set xtics nomirror
set border 3

plot data using 2:(1.0) with points pt '-' font ":Bold"

pause -1 "Hit <cr> to continue"
reset