Add recipe for seriestype=:stepmid

This commit is contained in:
David MacMahon 2021-03-24 20:47:14 -07:00
parent 3bb406e0ea
commit 50f1106cd7

View File

@ -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)