I am trying to make a horizontal bar plot with error bars, but I am having issues:
using Plots, Distributions
labels = ["aaa","bbb","ccc"]
values = [10,8,7]
sd = [2.2,0.8,1.5]
n = 30
errors = quantile(Normal(0,1),0.975) .* sd ./ sqrt(30)
- Vertical bars plot with error bars: this work normally…
bar(labels,values,yerror=errors)
- Horizontal bars plot: this somehow works, even if it leaves extra space (eventually with
yflip=true
we leave the empty space in the bottom)…
bar(values, orientation=:h, yticks=(1:length(labels),labels))
- Horizontal bars plot with error bars. This is completely messed up (I have tried also with yerrors)…
bar(values, orientation=:h, yticks=(1:length(labels),labels),xerror=sd)