From bb08d617091dd6dc1f56f5969c9dca0eafe35846 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Miclu=C8=9Ba-C=C3=A2mpeanu?= Date: Sat, 14 Mar 2020 21:27:12 +0200 Subject: [PATCH] Add _recipe_before_series --- src/Plots.jl | 3 ++- src/plot.jl | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/Plots.jl b/src/Plots.jl index 4f644127..831414f6 100644 --- a/src/Plots.jl +++ b/src/Plots.jl @@ -23,7 +23,8 @@ import RecipeUtils: _process_userrecipes, _process_plotrecipe, preprocessArgs!, is_st_supported, recipe_pipeline!, _recipe_init!, _recipe_after_user!, - _recipe_after_plot!, _recipe_finish! + _recipe_after_plot!, _recipe_before_series!, + _recipe_finish! using Requires diff --git a/src/plot.jl b/src/plot.jl index f74e6d5d..42ae43eb 100644 --- a/src/plot.jl +++ b/src/plot.jl @@ -155,7 +155,7 @@ function plot!(plt::Plot, args...; kw...) plotattributes = KW(kw) preprocessArgs!(plotattributes) # merge!(plt.user_attr, plotattributes) - recipe_pipeline!(plt, plotattributes, args) + recipe_pipeline!(plt, plotattributes, args, _typeAliases=_typeAliases) end # ------------------------------------------------------------------------------- @@ -174,7 +174,7 @@ function _recipe_init!(plt::Plot, plotattributes::AKW, args::Tuple) end end -function _recipe_after_plot!(plt::Plot, plotattributes::AKW, args::Tuple) +function _recipe_after_plot!(plt::Plot, plotattributes::AKW, kw_list::Vector{KW}) # -------------------------------- # Plot/Subplot/Layout setup # -------------------------------- @@ -182,6 +182,16 @@ function _recipe_after_plot!(plt::Plot, plotattributes::AKW, args::Tuple) _subplot_setup(plt, plotattributes, kw_list) end +function _recipe_before_series!(plt::Plot, kw, kw_list) + sp::Subplot = kw[:subplot] + + # 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)) + + series_attr = Attr(kw, _series_defaults) +end + function _recipe_finish!(plt::Plot, plotattributes::AKW, args::Tuple) current(plt)