
The rest of the plot is trivial, and this script results in the following graph:
GNUPLOT HELP PLUS
Therefore, if we take the square root of the sum of residuals divided by the number of degrees of freedom plus one, we get the standard deviation. However, we know that the number of degrees of freedoms is one less, than the number of data points, for we fit a function with a single parameter. One of them is the sum of the residuals, which is called FIT_WSSR, while another is the number of degrees of freedom, FIT_NDF. What we utilise here is the fact that the fit function also sets a couple of variables. Mean_y w l lt 3, 'stats2.dat' u 1:2 w p pt 7 lt 1 ps 1 Mean_y+stddev_y with filledcurves y1=mean_y lt 1 lc rgb "#bbbbdd", \ Plot mean_y-stddev_y with filledcurves y1=mean_y lt 1 lc rgb "#bbbbdd", \ Set label 2 gprintf("Standard deviation = %g", stddev_y) at 2, min_y-0.35 Set label 1 gprintf("Mean = %g", mean_y) at 2, min_y-0.2 # Plotting the range of standard deviation with a shaded background Stddev_y = sqrt(FIT_WSSR / (FIT_NDF + 1 )) Easy enough, and in just a couple of lines, we created this figure In the plotting section, we produce three labels, that tell us something about the data set, and plot the data range with shaded region. You can convince yourself that this returns the average of the data set.

This plot does nothing but fills in the values of the minimum and maximum of the data set.

Max_y with filledcurves y1=mean_y lt 1 lc rgb "#bbddbb", \Īt the beginning of our script, we just produce some dummy data, and call a dummy plot. Plot min_y with filledcurves y1=mean_y lt 1 lc rgb "#bbbbdd", \ Set label 3 gprintf("Mean = %g", mean_y) at 2, max_y+0.35 Set label 2 gprintf("Maximum = %g", max_y) at 2, max_y+0.2 Set label 1 gprintf("Minimum = %g", min_y) at 2, min_y-0.2 # Plotting the minimum and maximum ranges with a shaded background
