From f8d36363b4b625594a25a567645250aade817d28 Mon Sep 17 00:00:00 2001 From: Daniel Schwabeneder Date: Mon, 6 Apr 2020 17:09:00 +0200 Subject: [PATCH 1/4] allow type recipes for numbers in surfaces --- src/series.jl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/series.jl b/src/series.jl index 40ec0213..df45576a 100644 --- a/src/series.jl +++ b/src/series.jl @@ -216,7 +216,10 @@ function _apply_type_recipe(plotattributes, v::AbstractArray, letter) end # special handling for Surface... need to properly unwrap and re-wrap -_apply_type_recipe(plotattributes, v::Surface{<:AMat{<:DataPoint}}) = v +_apply_type_recipe( + plotattributes, + v::Surface{<:AMat{<:Union{AbstractFloat, Integer, Missing}}}, +) = v function _apply_type_recipe(plotattributes, v::Surface) ret = _apply_type_recipe(plotattributes, v.surf) if typeof(ret) <: Formatted @@ -229,7 +232,11 @@ end # don't do anything vectors of datapoints and for nothing _apply_type_recipe(plotattributes, v::Nothing, letter) = v _apply_type_recipe(plotattributes, v::AbstractArray{<:MaybeString}, letter) = v -_apply_type_recipe(plotattributes, v::AbstractArray{<:Union{Real, Nothing}}, letter) = v +_apply_type_recipe( + plotattributes, + v::AbstractArray{<:Union{AbstractFloat, Integer, Missing}}, + letter, +) = v # axis args before type recipes should still be mapped to all axes function _preprocess_axis_args!(plotattributes) From 54d441b62a7fc660060d0cfe1403c6f73a014226 Mon Sep 17 00:00:00 2001 From: Daniel Schwabeneder Date: Mon, 6 Apr 2020 17:10:27 +0200 Subject: [PATCH 2/4] bump versio --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 0b4ebefb..30da8343 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Plots" uuid = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" author = ["Tom Breloff (@tbreloff)"] -version = "1.0.2" +version = "1.0.3" [deps] Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" From 59e4129194738ef98fe4deaa8d58fb958f221518 Mon Sep 17 00:00:00 2001 From: Daniel Schwabeneder Date: Mon, 6 Apr 2020 17:25:18 +0200 Subject: [PATCH 3/4] skip maybestrings --- src/series.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/series.jl b/src/series.jl index df45576a..0e021767 100644 --- a/src/series.jl +++ b/src/series.jl @@ -216,6 +216,7 @@ function _apply_type_recipe(plotattributes, v::AbstractArray, letter) end # special handling for Surface... need to properly unwrap and re-wrap +_apply_type_recipe(plotattributes, v::Surface{<:AMat{MaybeString}}, letter) = v _apply_type_recipe( plotattributes, v::Surface{<:AMat{<:Union{AbstractFloat, Integer, Missing}}}, From 3dd1c500cfd214e49ef4caf6d057965506b7c695 Mon Sep 17 00:00:00 2001 From: Daniel Schwabeneder Date: Mon, 6 Apr 2020 17:40:31 +0200 Subject: [PATCH 4/4] fix ambiguity --- src/series.jl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/series.jl b/src/series.jl index 0e021767..7cd0a3f0 100644 --- a/src/series.jl +++ b/src/series.jl @@ -216,10 +216,9 @@ function _apply_type_recipe(plotattributes, v::AbstractArray, letter) end # special handling for Surface... need to properly unwrap and re-wrap -_apply_type_recipe(plotattributes, v::Surface{<:AMat{MaybeString}}, letter) = v _apply_type_recipe( plotattributes, - v::Surface{<:AMat{<:Union{AbstractFloat, Integer, Missing}}}, + v::Surface{<:AMat{<:Union{AbstractFloat, Integer, AbstractString, Missing}}}, ) = v function _apply_type_recipe(plotattributes, v::Surface) ret = _apply_type_recipe(plotattributes, v.surf) @@ -232,10 +231,9 @@ end # don't do anything vectors of datapoints and for nothing _apply_type_recipe(plotattributes, v::Nothing, letter) = v -_apply_type_recipe(plotattributes, v::AbstractArray{<:MaybeString}, letter) = v _apply_type_recipe( plotattributes, - v::AbstractArray{<:Union{AbstractFloat, Integer, Missing}}, + v::AbstractArray{<:Union{AbstractFloat, Integer, AbstractString, Missing}}, letter, ) = v