From 45e0aaacb4c0806a34784f56ce98d445d985240f Mon Sep 17 00:00:00 2001 From: Gustavo Goretkin Date: Fri, 15 Dec 2017 13:52:40 -0500 Subject: [PATCH] Draw hline and vline beyond plot limits --- src/recipes.jl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/recipes.jl b/src/recipes.jl index 5eab486f..c69e5316 100644 --- a/src/recipes.jl +++ b/src/recipes.jl @@ -80,11 +80,14 @@ end @recipe function f(::Type{Val{:hline}}, x, y, z) xmin, xmax = hvline_limits(plotattributes[:subplot][:xaxis]) + span = xmax - xmin 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]) x := newx y := newy + x_extent_data := Float64[] + y_extent_data := newy seriestype := :path () end @@ -92,11 +95,14 @@ end @recipe function f(::Type{Val{:vline}}, x, y, z) ymin, ymax = hvline_limits(plotattributes[:subplot][:yaxis]) + span = ymax - ymin n = length(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 y := newy + x_extent_data := newx + y_extent_data := Float64[] seriestype := :path () end