diff --git a/src/pipeline.jl b/src/pipeline.jl index c360649b..d87c5836 100644 --- a/src/pipeline.jl +++ b/src/pipeline.jl @@ -313,7 +313,7 @@ function _prepare_subplot(plt::Plot{T}, plotattributes::AKW) where {T} st = _override_seriestype_check(plotattributes, st) # change to a 3d projection for this subplot? - if RecipesPipeline.needs_3d_axes(st) + if RecipesPipeline.needs_3d_axes(st) || (st == :quiver && plotattributes[:z] !== nothing) sp.attr[:projection] = "3d" end @@ -329,7 +329,7 @@ function _override_seriestype_check(plotattributes::AKW, st::Symbol) # do we want to override the series type? if !RecipesPipeline.is3d(st) && !(st in (:contour, :contour3d, :quiver)) z = plotattributes[:z] - if !isa(z, Nothing) && + if z !== nothing && (size(plotattributes[:x]) == size(plotattributes[:y]) == size(z)) st = (st == :scatter ? :scatter3d : :path3d) plotattributes[:seriestype] = st diff --git a/test/test_axes.jl b/test/test_axes.jl index 3f2170cb..78ca09ac 100644 --- a/test/test_axes.jl +++ b/test/test_axes.jl @@ -36,3 +36,8 @@ end pl = plot(1:5, xlims=:symmetric, widen = false) @test Plots.xlims(pl) == (-5, 5) end + +@testset "3D Axis" begin + ql = quiver([1, 2], [2, 1], [3, 4], quiver = ([1, -1], [0, 0], [1, -0.5]), arrow=true) + @test ql[1][:projection] == "3d" +end