From 5cc08a17b697d9641df3a7f4ea284907971af692 Mon Sep 17 00:00:00 2001 From: David Gustavsson Date: Sun, 28 Feb 2021 08:57:54 +0100 Subject: [PATCH 1/2] Series annotations for bar plots --- src/recipes.jl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/recipes.jl b/src/recipes.jl index 46ef79a1..acb43161 100644 --- a/src/recipes.jl +++ b/src/recipes.jl @@ -415,6 +415,11 @@ end fillto = map(x -> _is_positive(x) ? typeof(baseline)(x) : baseline, fillto) end + if !isnothing(plotattributes[:series_annotations]) + annotations := (x,y,plotattributes[:series_annotations].strs,:bottom) + series_annotations := nothing + end + # create the bar shapes by adding x/y segments xseg, yseg = Segments(), Segments() for i = 1:ny From a75d309d207891b077525c43f587e5987b43f2c1 Mon Sep 17 00:00:00 2001 From: David Gustavsson Date: Sun, 28 Feb 2021 09:20:20 +0100 Subject: [PATCH 2/2] Labels for horizontal bars --- src/recipes.jl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/recipes.jl b/src/recipes.jl index acb43161..68422966 100644 --- a/src/recipes.jl +++ b/src/recipes.jl @@ -416,7 +416,11 @@ end end if !isnothing(plotattributes[:series_annotations]) - annotations := (x,y,plotattributes[:series_annotations].strs,:bottom) + if isvertical(plotattributes) + annotations := (x,y,plotattributes[:series_annotations].strs,:bottom) + else + annotations := (y,x,plotattributes[:series_annotations].strs,:left) + end series_annotations := nothing end