diff --git a/src/recipes.jl b/src/recipes.jl index b188a33d..1ecbea62 100644 --- a/src/recipes.jl +++ b/src/recipes.jl @@ -229,6 +229,31 @@ make_steps(t::Tuple, st, even) = Tuple(make_steps(ti, st, even) for ti in t) end @deps steppre path scatter +# create a path from steps +@recipe function f(::Type{Val{:stepmid}}, x, y, z) + plotattributes[:x] = make_steps(x, :mid, true) + plotattributes[:y] = make_steps(y, :post, true) + seriestype := :path + + # handle fillrange + plotattributes[:fillrange] = make_steps(plotattributes[:fillrange], :post, true) + + # create a secondary series for the markers + if plotattributes[:markershape] != :none + @series begin + seriestype := :scatter + x := x + y := y + label := "" + primary := false + () + end + markershape := :none + end + () +end +@deps stepmid path scatter + # create a path from steps @recipe function f(::Type{Val{:steppost}}, x, y, z) plotattributes[:x] = make_steps(x, :pre, false)