add prepareSeriesData method for AbstractRanges

This commit is contained in:
Daniel Schwabeneder 2020-03-16 22:20:42 +01:00
parent 35c68c8890
commit 4b5ec3ad07

View File

@ -15,6 +15,7 @@ prepareSeriesData(x) = error("Cannot convert $(typeof(x)) to series data for plo
prepareSeriesData(::Nothing) = nothing prepareSeriesData(::Nothing) = nothing
prepareSeriesData(t::Tuple{T, T}) where {T<:Number} = t prepareSeriesData(t::Tuple{T, T}) where {T<:Number} = t
prepareSeriesData(f::Function) = f prepareSeriesData(f::Function) = f
prepareSeriesData(ar::AbstractRange{<:Number}) = ar
function prepareSeriesData(a::AbstractArray{<:MaybeNumber}) function prepareSeriesData(a::AbstractArray{<:MaybeNumber})
f = isimmutable(a) ? replace : replace! f = isimmutable(a) ? replace : replace!
a = f(x -> ismissing(x) || isinf(x) ? NaN : x, map(float, a)) a = f(x -> ismissing(x) || isinf(x) ? NaN : x, map(float, a))