From 6d9f224c744c06b879eadf6563b3cafd8f4d8ff5 Mon Sep 17 00:00:00 2001 From: Adrian Dawid Date: Tue, 11 Aug 2020 01:14:35 +0200 Subject: [PATCH] Make it work in practice --- src/args.jl | 2 +- src/pipeline.jl | 8 ++++++-- src/recipes.jl | 7 +++++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/args.jl b/src/args.jl index e2051abb..6d54c245 100644 --- a/src/args.jl +++ b/src/args.jl @@ -38,7 +38,7 @@ const _axesAliases = Dict{Symbol,Symbol}( ) const _3dTypes = [ - :path3d, :scatter3d, :surface, :wireframe, :contour3d, :volume + :path3d, :scatter3d, :surface, :wireframe, :contour3d, :volume, :mesh3d ] const _allTypes = vcat([ :none, :line, :path, :steppre, :steppost, :sticks, :scatter, diff --git a/src/pipeline.jl b/src/pipeline.jl index e0130f3f..d2830ba9 100644 --- a/src/pipeline.jl +++ b/src/pipeline.jl @@ -328,12 +328,16 @@ end function _override_seriestype_check(plotattributes::AKW, st::Symbol) # do we want to override the series type? + println(RecipesPipeline.is3d(st)) + println(st) if !RecipesPipeline.is3d(st) && !(st in (:contour, :contour3d)) z = plotattributes[:z] if !isa(z, Nothing) && - (size(plotattributes[:x]) == size(plotattributes[:y]) == size(z)) + (size(plotattributes[:x]) == size(plotattributes[:y]) == size(z)) && + st !== :mesh3d st = (st == :scatter ? :scatter3d : :path3d) - plotattributes[:seriestype] = st + println("hello hello hello") + plotattributes[:seriestype] = st end end st diff --git a/src/recipes.jl b/src/recipes.jl index eb4550db..8accfca9 100644 --- a/src/recipes.jl +++ b/src/recipes.jl @@ -1536,3 +1536,10 @@ julia> areaplot(1:3, [1 2 3; 7 8 9; 4 5 6], seriescolor = [:red :green :blue], f end is_3d(::Type{Val{:mesh3d}}) = true +# --------------------------------------------------------------------------- +# mesh 3d + +@recipe function f(::Type{Val{:mesh3d}}, x, y, z) + seriestype := :mesh3d + () +end