File: stats.dem

package info (click to toggle)
gnuplot5 5.0.0~rc%2Bdfsg2-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 11,548 kB
  • ctags: 8,104
  • sloc: ansic: 77,108; cpp: 6,848; makefile: 1,932; sh: 1,343; lisp: 657; perl: 302; awk: 235; pascal: 194; tcl: 88; python: 46
file content (45 lines) | stat: -rw-r--r-- 1,445 bytes parent folder | download | duplicates (8)
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
#
# Exercise the "stats" command.
# Skip this demo cleanly if the stats option was not configured.
#
if (!strstrt(GPVAL_COMPILE_OPTIONS,"+STATS")) {
    print "No support for stats command"
} else {

set title "Use of stats command to find min/max/mean before plotting\nOne data column"

set style data line
set offset 0,0,.5,.5
set autoscale fix
set key left Left

stats 'orbital_elements.dat' index 1 using 2 prefix "A"

set arrow 1 from A_index_min, graph 0.1 to A_index_min, A_min fill
set arrow 2 from A_index_max, graph 0.9 to A_index_max, A_max fill
set label 1 at A_index_min, graph 0.1 "min" center offset 0,-1
set label 2 at A_index_max, graph 0.9 "max" center offset 0,1

plot 'orbital_elements.dat' index 1 using 0:2 title "  Data" lw 2, \
     A_mean title "  Mean"

pause -1 "Hit return to continue"

set title "Use of stats command to find min/max/mean before plotting\nTwo data columns"

f(x) = log(1+x)

stats 'orbital_elements.dat' index 1 using (f($0)):2 prefix "B"

set arrow 1 from B_pos_min_y, graph 0.1 to B_pos_min_y, B_min_y fill
set arrow 2 from B_pos_max_y, graph 0.9 to B_pos_max_y, B_max_y fill
set label 1 at B_pos_min_y, graph 0.1 "min" center offset 0,-1
set label 2 at B_pos_max_y, graph 0.9 "max" center offset 0,1

plot 'orbital_elements.dat' index 1 using (f($0)):2 title "  Data" lw 2, \
     B_mean_y title "  Mean", \
     B_slope * x + B_intercept title "Linear fit"

pause -1 "Hit return to continue"

}