From abebbdd54aab9ec673a7557e7379010ad2307804 Mon Sep 17 00:00:00 2001 From: Ronny Bergmann Date: Fri, 13 Nov 2020 09:29:43 +0100 Subject: [PATCH] fixes two checks for 3D to work properly. --- src/recipes.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/recipes.jl b/src/recipes.jl index 15d41336..41d36714 100644 --- a/src/recipes.jl +++ b/src/recipes.jl @@ -1197,7 +1197,7 @@ function quiver_using_arrows(plotattributes::AKW) if !isa(plotattributes[:arrow], Arrow) plotattributes[:arrow] = arrow() end - is_3d = haskey(plotattributes,:z) + is_3d = haskey(plotattributes,:z) && !isnothing(plotattributes[:z]) velocity = error_zipit(plotattributes[:quiver]) xorig, yorig = plotattributes[:x], plotattributes[:y] zorig = is_3d ? plotattributes[:z] : [] @@ -1205,7 +1205,7 @@ function quiver_using_arrows(plotattributes::AKW) # for each point, we create an arrow of velocity vi, translated to the x/y coordinates x, y = zeros(0), zeros(0) is_3d && ( z = zeros(0)) - for i = 1:max(length(xorig), length(yorig), length(zorig)) + for i = 1:max(length(xorig), length(yorig), is_3d ? 0 : length(zorig)) # get the starting position xi = _cycle(xorig, i) yi = _cycle(yorig, i)