Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposes a 3D quiver #3134

Merged
merged 12 commits into from
Nov 13, 2020
Prev Previous commit
Next Next commit
fixes two checks for 3D to work properly.
  • Loading branch information
kellertuer committed Nov 13, 2020
commit abebbdd54aab9ec673a7557e7379010ad2307804
4 changes: 2 additions & 2 deletions src/recipes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1197,15 +1197,15 @@ 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] : []

# 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)
Expand Down