allow plotting of Any vectors

This commit is contained in:
Daniel Schwabeneder 2019-08-27 14:15:01 +02:00
parent ff774dc409
commit 844c3f7002

View File

@ -30,7 +30,13 @@ convertToAnyVector(n::Integer) = Any[zeros(0) for i in 1:n]
convertToAnyVector(v::AVec{<:DataPoint}) = Any[prepareSeriesData(v)]
# list of things (maybe other vectors, functions, or something else)
convertToAnyVector(v::AVec) = vcat((convertToAnyVector(vi) for vi in v)...)
function convertToAnyVector(v::AVec)
if all(x -> isa(x, Number) || ismissing(x), v) || all(x -> isa(x, AbstractString) || ismissing(x), v)
convertToAnyVector(convert.(DataPoint, v))
else
Any[prepareSeriesData(v)] : vcat((convertToAnyVector(vi) for vi in v)...)
end
end
# Matrix is split into columns
convertToAnyVector(v::AMat{<:DataPoint}) = Any[prepareSeriesData(v[:,i]) for i in 1:size(v,2)]