From 32c725e77079e7bd1716f1c097e4bede8ee765dc Mon Sep 17 00:00:00 2001 From: Simon Christ Date: Sat, 9 May 2020 13:05:15 +0200 Subject: [PATCH] error bars behind in scatterplots (#2677) * errors behind for :scatter * fix plots with no seriestype --- src/pipeline.jl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/pipeline.jl b/src/pipeline.jl index c595a80e..146facbd 100644 --- a/src/pipeline.jl +++ b/src/pipeline.jl @@ -155,8 +155,23 @@ RecipesPipeline.type_alias(plt::Plot) = get(_typeAliases, st, st) function RecipesPipeline.plot_setup!(plt::Plot, plotattributes, kw_list) _plot_setup(plt, plotattributes, kw_list) _subplot_setup(plt, plotattributes, kw_list) + return nothing end +function RecipesPipeline.process_sliced_series_attributes!(plt::Plots.Plot, kw_list) + # swap errors + err_inds = findall(kw -> get(kw, :seriestype, nothing) in (:xerror, :yerror, :zerror), kw_list) + for ind in err_inds + if kw_list[ind-1][:seriestype] == :scatter + tmp = copy(kw_list[ind]) + kw_list[ind] = copy(kw_list[ind-1]) + kw_list[ind-1] = tmp + end + end + return nothing +end + + # TODO: Should some of this logic be moved to RecipesPipeline? function _plot_setup(plt::Plot, plotattributes::AKW, kw_list::Vector{KW}) # merge in anything meant for the Plot @@ -274,6 +289,7 @@ function RecipesPipeline.slice_series_attributes!(plt::Plot, kw_list, kw) # in series attributes given as vector with one element per series, # select the value for current series _slice_series_args!(kw, plt, sp, series_idx(kw_list, kw)) + return nothing end RecipesPipeline.series_defaults(plt::Plot) = _series_defaults # in args.jl