From 12e34bb24f48048dcc26c9a056752b16f2c8fe75 Mon Sep 17 00:00:00 2001 From: yha Date: Thu, 25 Jul 2019 18:29:49 +0300 Subject: [PATCH] Fix comment, move all3D method --- src/series.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/series.jl b/src/series.jl index 6cbaee82..ed7a719e 100644 --- a/src/series.jl +++ b/src/series.jl @@ -10,8 +10,6 @@ const FuncOrFuncs{F} = Union{F, Vector{F}, Matrix{F}} const DataPoint = Union{Number, AbstractString, Missing} const SeriesData = Union{AVec{<:DataPoint}, Function, Surface, Volume} -all3D(plotattributes::KW) = trueOrAllTrue(st -> st in (:contour, :contourf, :heatmap, :surface, :wireframe, :contour3d, :image, :plots_heatmap), get(plotattributes, :seriestype, :none)) - prepareSeriesData(x) = error("Cannot convert $(typeof(x)) to series data for plotting") prepareSeriesData(::Nothing) = nothing prepareSeriesData(s::SeriesData) = handlemissings(s) @@ -34,7 +32,7 @@ convertToAnyVector(v::AVec{<:DataPoint}) = Any[prepareSeriesData(v)] # list of things (maybe other vectors, functions, or something else) convertToAnyVector(v::AVec) = vcat((convertToAnyVector(vi, plotattributes) for vi in v)...) -# Matrix is split into rows +# Matrix is split into columns convertToAnyVector(v::AMat{<:DataPoint}) = Any[prepareSeriesData(v[:,i]) for i in 1:size(v,2)] # -------------------------------------------------------------------- @@ -257,6 +255,8 @@ end @recipe f(n::Integer) = is3d(get(plotattributes,:seriestype,:path)) ? (SliceIt, n, n, n) : (SliceIt, n, n, nothing) +all3D(plotattributes::KW) = trueOrAllTrue(st -> st in (:contour, :contourf, :heatmap, :surface, :wireframe, :contour3d, :image, :plots_heatmap), get(plotattributes, :seriestype, :none)) + # return a surface if this is a 3d plot, otherwise let it be sliced up @recipe function f(mat::AMat{T}) where T<:Union{Integer,AbstractFloat,Missing} if all3D(plotattributes)