From e816895e5010175ddbcda2d6b6b2238d3436813a Mon Sep 17 00:00:00 2001 From: Simon Christ Date: Tue, 3 Mar 2020 23:11:58 +0100 Subject: [PATCH] check bbox type --- src/recipes.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/recipes.jl b/src/recipes.jl index 806bbc82..dc94c1a9 100644 --- a/src/recipes.jl +++ b/src/recipes.jl @@ -904,8 +904,10 @@ end lens!(args...;kwargs...) = plot!(args...; seriestype=:lens, kwargs...) export lens! @recipe function f(::Type{Val{:lens}}, plt::AbstractPlot) - # TODO: validate input sp_index, inset_bbox = plotattributes[:inset_subplots] + if !(width(inset_bbox) isa Measures.Length{:w,<:Real}) + throw(ArgumentError("Inset bounding box needs to in relative coordinates.")) + end sp = plt.subplots[sp_index] xl1, xl2 = xlims(plt.subplots[sp_index]) bbx1 = xl1 + left(inset_bbox).value * (xl2 - xl1)