Is it possible to plot an “error” that asymmetric around the “mean”? That is, I want to plot the ribbon around the line f(x) with the error interval [f(x) - err1(x), f(x) + err2(x)], where err1(x) != err2(x).
Sorry @mkborregaard , I made some last minute changes to the MWE and broke it. It should just be:
a = 0.0
b = randn(10)
med_b = median(b)
max_b = maximum(b)
min_b = minimum(b)
scatter((a, med_b),
yerror=(med_b-min_b,
max_b-med_b))
Which gives me
unexpected ebi type Array{Tuple{Float64,Float64},0} for errorbar: (1.6075403984383283, 1.2973639900098863)
However, since you mentioned it, I decided trying this out with vectors and it indeed works.
a = 1:10
b = [randn(10) for _ in a]
med_b = [median(x) for x in b]
max_b = [maximum(x) for x in b]
min_b = [minimum(x) for x in b]
scatter((a, med_b),
yerror=(med_b-min_b,
max_b-med_b))
This gives me what I want.
But now I’m not sure what I’m missing in the first MWE.
Building on this example, is there a way to ensure that the label for the plot uses the marker “shape” and not the “ribbon” color? Use case is when printed (black and white), it’s still clear which label goes with which line. Example below, label is tied to ribbon color, not marker shape.
Possibly the issue arises using StatsPlots @df macro. I have all my errors in one dataframe column where each entry is a tuple. I guess this is why doesn’t work in general. However it seems to be fine with Plotlyjs