In [1]:
using Plots
pyplot(leg=false, size=(500,300))
srand(1)

sds = [1, 1/2, 1/4, 1/8, 1/16, 1/32]
n = 10
y = [mean(sd*randn(n)) for sd in sds]
errs = 1.96 * sds / sqrt(n)

plot(y, err = errs)


[Plots.jl] Initializing backend: pyplot
Out[1]:

In [2]:
plot(y, 1:length(y), xerr = errs,
     marker = stroke(3,:orange))


Out[2]:

In [3]:
plot(y, ribbon=errs, fill=:cyan)


Out[3]:

In [4]:
n = 10
x = [(rand()+1) * randn(n) + 2i for i in 1:5]
y = [(rand()+1) * randn(n) + i for i in 1:5]

f(v) = 1.96std(v) / sqrt(n)
xerr = map(f, x)
yerr = map(f, y)
x = map(mean, x)
y = map(mean, y)

plot(x, y, xerr = xerr, yerr = yerr, marker = stroke(2, :orange))


Out[4]:

In [5]:
# asymmetric errors
plot(x, y, xerr = (0.5xerr,2xerr), yerr = (0.5yerr,2yerr), marker = stroke(2, :orange))


Out[5]:

In [8]:
png("/tmp/tmp")

In [ ]: