diff --git a/src/types.jl b/src/types.jl index 6dc6067e2..c94571d71 100644 --- a/src/types.jl +++ b/src/types.jl @@ -19,6 +19,14 @@ mutable struct Series plotattributes::DefaultsDict end +@recipe function f(s::Series) + for (k, v) in s.plotattributes + k in (:subplot, :yerror, :xerror, :zerror) && continue + plotattributes[k] = v + end + () +end + # a single subplot mutable struct Subplot{T<:AbstractBackend} <: AbstractLayout parent::AbstractLayout diff --git a/test/test_recipes.jl b/test/test_recipes.jl index a7fe5007f..9e3580483 100644 --- a/test/test_recipes.jl +++ b/test/test_recipes.jl @@ -1,5 +1,12 @@ using OffsetArrays +@testset "Series" begin + pl = plot(1:3, yerror = 1) + @test plot(pl[1][1])[1][1][:primary] == true + @test plot(pl[1][2])[1][1][:primary] == false + @test isequal(plot(pl[1][2])[1][1][:y], pl[1][2][:y]) +end + @testset "User recipes" begin struct LegendPlot end @recipe function f(plot::LegendPlot)