Plots.jl series with only errorbars?

Is it possible to make a plot with only error bars using Plots.jl? Alternatively, is it possible to style the errorbars independent of the associate :path or :scatter series?

basically want

x = collect(1:5); y = 5*x; e = log.(y)
plot(x, y, yerror = e)

but with no line connecting the mid-point of the error bars. Tried to set the linealpha to zero, but that also impacts how the errorbars are drawn.

For a workaround, you may try this:

using Plots; gr()
default(lw=0.5, lc=:black, label=false)

x = collect(1:5); y = 5*x; e = log.(y)
dx = diff([extrema(x)...])[1]/150
plot([x'; x'], [(y-e)';(y+e)'])
plot!([x'.-dx; x'.+dx], [(y-e)';(y-e)'])
plot!([x'.-dx; x'.+dx], [(y+e)';(y+e)'])

thanks, that’s a sufficient workaround.

1 Like