From 972c97d5ec80742a81b3cfdfc7e8577eafb0f33a Mon Sep 17 00:00:00 2001 From: yha Date: Tue, 4 Jun 2019 20:41:35 +0300 Subject: [PATCH 1/2] Fix for missing as first element --- src/series.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/series.jl b/src/series.jl index 9bfcafc7..5f82e4cf 100644 --- a/src/series.jl +++ b/src/series.jl @@ -194,7 +194,8 @@ _apply_type_recipe(plotattributes, v) = RecipesBase.apply_recipe(plotattributes, # and one to format tick values. function _apply_type_recipe(plotattributes, v::AbstractArray) isempty(v) && return Float64[] - args = RecipesBase.apply_recipe(plotattributes, typeof(v[1]), v[1])[1].args + x = first(skipmissing(v)) + args = RecipesBase.apply_recipe(plotattributes, typeof(x), x)[1].args if length(args) == 2 && typeof(args[1]) <: Function && typeof(args[2]) <: Function numfunc, formatter = args Formatted(map(numfunc, v), formatter) From 4c22a421a17e8ea0117b18f8c3dd067906b4dbc0 Mon Sep 17 00:00:00 2001 From: yha Date: Tue, 4 Jun 2019 21:00:52 +0300 Subject: [PATCH 2/2] No error when input is all missing --- src/series.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/series.jl b/src/series.jl index 5f82e4cf..cb6daaf2 100644 --- a/src/series.jl +++ b/src/series.jl @@ -193,7 +193,7 @@ _apply_type_recipe(plotattributes, v) = RecipesBase.apply_recipe(plotattributes, # This sort of recipe should return a pair of functions... one to convert to number, # and one to format tick values. function _apply_type_recipe(plotattributes, v::AbstractArray) - isempty(v) && return Float64[] + isempty(skipmissing(v)) && return Float64[] x = first(skipmissing(v)) args = RecipesBase.apply_recipe(plotattributes, typeof(x), x)[1].args if length(args) == 2 && typeof(args[1]) <: Function && typeof(args[2]) <: Function