From d290c6702a052176f235d52c6a2847f4036f41d8 Mon Sep 17 00:00:00 2001 From: Thomas Breloff Date: Sat, 8 Oct 2016 22:00:22 -0400 Subject: [PATCH] handle series_attr merge and add_defaults when combining subplots; closes #526 --- src/plot.jl | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/plot.jl b/src/plot.jl index 87f06ea1..6d05ba66 100644 --- a/src/plot.jl +++ b/src/plot.jl @@ -89,8 +89,16 @@ function plot(plt1::Plot, plts_tail::Plot...; kw...) plt.o = _create_backend_figure(plt) plt.init = true + series_attr = KW() + for (k,v) in d + if haskey(_series_defaults, k) + series_attr[k] = pop!(d,k) + end + end + # create the layout and initialize the subplots plt.layout, plt.subplots, plt.spmap = build_layout(layout, num_sp, copy(plts)) + cmdidx = 1 for (idx, sp) in enumerate(plt.subplots) _initialize_subplot(plt, sp) serieslist = series_list(sp) @@ -100,8 +108,11 @@ function plot(plt1::Plot, plts_tail::Plot...; kw...) sp.plt = plt sp.attr[:subplot_index] = idx for series in serieslist + merge!(series.d, series_attr) + _add_defaults!(series.d, plt, sp, cmdidx) push!(plt.series_list, series) _series_added(plt, series) + cmdidx += 1 end end