I have a type like this
struct Errorful
val::Float64
std::Float64
end
that represents a number with an error bar. I would like to have a @recipe
, such that plotting an array of these
@assert eltype(ys) == Errorful
plot(xs, ys)
gives something like this:
How to do this? I tried
@recipe function plot(xs::AbstractVector, ys::AbstractVector{Errorful{<:Number}})
:yerr --> std.(ys)
xs, value.(ys)
end
plot(xs, ys)
But it throws an error and inserting some println
shows that the recipe is never called.