|
From: Stuart K. <stu...@gm...> - 2014-08-30 14:19:28
|
How might I calculate two standard deviations?
Using the STATS package, I'm calculating one stdev, but I don't see an
obvious way to do two.
?
--sk
Stuart Kendrick
$ cat gnuplot.gp
[...]
# Calculate statistics
stats input_file index 0 using ((($1/1000.0)/1000.0)/8.0)
# Figure out where to put the labels
line_width = (STATS_max - STATS_min) / 25
y_offset = STATS_records * .1
# Stats labels
set label 1 sprintf("Minimum = %.2f", STATS_min) at y_offset,
STATS_min + line_width*5 front
set label 2 sprintf("Maximum = %.2f", STATS_max) at y_offset,
STATS_min + line_width*4 front
set label 3 sprintf("Mean = %.2f" , STATS_mean) at y_offset,
STATS_min + line_width*3 front
set label 4 sprintf("Median = %.2f", STATS_median) at y_offset,
STATS_min + line_width*2 front
set label 5 sprintf("Stdev= %.2f", STATS_stddev) at y_offset,
STATS_min + line_width*1 front
# Do the work
plot input_file index 0 using 0:((($1/1000.0)/1000.0)/8.0) title ''
with points pointtype 7 pointsize 2 linecolor rgb \ "blue",
STATS_median title " Median" linecolor rgb "green", STATS_mean title "
Mean" linecolor rgb "purple"
|