1

I know that errorbars or candlebars with whiskerbars can be plotted by gnuplot by giving it mean, max, min, deviation...

Is there a way how to compute these automatically? I have got a file, each line should be one errorbar, first column is x, another eleven columns are distinct measurements of some f(x).

1 Answer 1

3

I will show how to plot error bars representing +/- sigma. You can adjust the formulae to suit if you want error bars representing unbiased standard error or min/max or something else.

# N is the number of data columns, i.e. columns 2 through N+1
sumx(N) = sum [i=2:N+1] column(i)
sumx2(N) = sum [i=2:N+1] column(i) * column(i)

mean(N) = sumx(N) / N
sigma(N) = sqrt( sumx2(N)/N - (sumx(N)/N)**2 )

N=11
plot 'datafile' using (column(1)) : (mean(N)) : (sigma(N)) with yerrorbars
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.