|
#
# 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"
Click here for minimal script to generate this plot
|