From f606f083a4ad45a51f5bd3f3c58964837c56085f Mon Sep 17 00:00:00 2001 From: Daniel Schwabeneder Date: Wed, 18 Mar 2020 01:43:42 +0100 Subject: [PATCH] fix for vectors containing missing --- src/series.jl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/series.jl b/src/series.jl index 787c7200..44fd7b95 100644 --- a/src/series.jl +++ b/src/series.jl @@ -180,14 +180,16 @@ _apply_type_recipe(plotattributes, v) = RecipesBase.apply_recipe(plotattributes, function _apply_type_recipe(plotattributes, v::AbstractArray) # First we try to apply an array type recipe. w = RecipesBase.apply_recipe(plotattributes, typeof(v), v)[1].args[1] - # If it did not change try it element-wise - if v == w + # If the type did not change try it element-wise + if typeof(v) == typeof(w) isempty(skipmissing(v)) && return Float64[] x = first(skipmissing(v)) args = RecipesBase.apply_recipe(plotattributes, typeof(x), x)[1].args if length(args) == 2 && all(arg -> arg isa Function, args) numfunc, formatter = args return Formatted(map(numfunc, v), formatter) + else + return v end end return w