hspan and vspan recipes

This commit is contained in:
Daniel Schwabeneder 2018-03-28 11:32:23 +02:00
parent 0ace28b784
commit f56d944870
2 changed files with 26 additions and 0 deletions

View File

@ -187,6 +187,8 @@ include("output.jl")
@shorthands sticks @shorthands sticks
@shorthands hline @shorthands hline
@shorthands vline @shorthands vline
@shorthands hspan
@shorthands vspan
@shorthands ohlc @shorthands ohlc
@shorthands contour @shorthands contour
@shorthands contourf @shorthands contourf

View File

@ -100,6 +100,30 @@ end
end end
@deps vline straightline @deps vline straightline
@recipe function f(::Type{Val{:hspan}}, x, y, z)
n = div(length(y), 2)
newx = repeat([-Inf, Inf, Inf, -Inf, NaN], outer = n)
newy = vcat([[y[2i-1], y[2i-1], y[2i], y[2i], NaN] for i in 1:n]...)
linewidth --> 0
x := newx
y := newy
seriestype := :shape
()
end
@deps hspan shape
@recipe function f(::Type{Val{:vspan}}, x, y, z)
n = div(length(y), 2)
newx = vcat([[y[2i-1], y[2i-1], y[2i], y[2i], NaN] for i in 1:n]...)
newy = repeat([-Inf, Inf, Inf, -Inf, NaN], outer = n)
linewidth --> 0
x := newx
y := newy
seriestype := :shape
()
end
@deps vspan shape
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# path and scatter # path and scatter