Draw hline and vline beyond plot limits

This commit is contained in:
Gustavo Goretkin 2017-12-15 13:52:40 -05:00
parent 41c5dbcf23
commit 45e0aaacb4

View File

@ -80,11 +80,14 @@ end
@recipe function f(::Type{Val{:hline}}, x, y, z) @recipe function f(::Type{Val{:hline}}, x, y, z)
xmin, xmax = hvline_limits(plotattributes[:subplot][:xaxis]) xmin, xmax = hvline_limits(plotattributes[:subplot][:xaxis])
span = xmax - xmin
n = length(y) n = length(y)
newx = repmat(Float64[xmin, xmax, NaN], n) newx = repmat(Float64[xmin-10span, xmax+10span, NaN], n)
newy = vec(Float64[yi for i=1:3,yi=y]) newy = vec(Float64[yi for i=1:3,yi=y])
x := newx x := newx
y := newy y := newy
x_extent_data := Float64[]
y_extent_data := newy
seriestype := :path seriestype := :path
() ()
end end
@ -92,11 +95,14 @@ end
@recipe function f(::Type{Val{:vline}}, x, y, z) @recipe function f(::Type{Val{:vline}}, x, y, z)
ymin, ymax = hvline_limits(plotattributes[:subplot][:yaxis]) ymin, ymax = hvline_limits(plotattributes[:subplot][:yaxis])
span = ymax - ymin
n = length(y) n = length(y)
newx = vec(Float64[yi for i=1:3,yi=y]) newx = vec(Float64[yi for i=1:3,yi=y])
newy = repmat(Float64[ymin, ymax, NaN], n) newy = repmat(Float64[ymin-10span, ymax+10span, NaN], n)
x := newx x := newx
y := newy y := newy
x_extent_data := newx
y_extent_data := Float64[]
seriestype := :path seriestype := :path
() ()
end end