From 17265e4c0c19b534fc962bfd574c124d78107b2a Mon Sep 17 00:00:00 2001 From: Daniel Schwabeneder Date: Sun, 1 Nov 2020 21:00:19 +0100 Subject: [PATCH 1/2] add recipe for list of NamedTuples --- RecipesPipeline/src/user_recipe.jl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/RecipesPipeline/src/user_recipe.jl b/RecipesPipeline/src/user_recipe.jl index a7b99327c..988c2e212 100644 --- a/RecipesPipeline/src/user_recipe.jl +++ b/RecipesPipeline/src/user_recipe.jl @@ -333,3 +333,16 @@ end # list of tuples @recipe f(v::AVec{<:Tuple}) = unzip(v) @recipe f(tup::Tuple) = [tup] + +# list of NamedTuples +@recipe function f(ntv::AVec{<:NamedTuple{K, Tuple{S, T}}}) where {K, S, T} + xguide --> string(K[1]) + yguide --> string(K[2]) + return Tuple.(ntv) +end +@recipe function f(ntv::AVec{<:NamedTuple{K, Tuple{R, S, T}}}) where {K, R, S, T} + xguide --> string(K[1]) + yguide --> string(K[2]) + zguide --> string(K[3]) + return Tuple.(ntv) +end \ No newline at end of file From bdab50451b5c6fbdec767ed985e8ae577384af9b Mon Sep 17 00:00:00 2001 From: Daniel Schwabeneder Date: Sun, 1 Nov 2020 21:13:13 +0100 Subject: [PATCH 2/2] add newline --- RecipesPipeline/src/user_recipe.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RecipesPipeline/src/user_recipe.jl b/RecipesPipeline/src/user_recipe.jl index 988c2e212..82424e63f 100644 --- a/RecipesPipeline/src/user_recipe.jl +++ b/RecipesPipeline/src/user_recipe.jl @@ -345,4 +345,4 @@ end yguide --> string(K[2]) zguide --> string(K[3]) return Tuple.(ntv) -end \ No newline at end of file +end