Move fillrange and ribbon logic from RecipesPipeline and add tests for default function (#4030)

* add tests for default function

* remove fillrange and ribbon handling from RecipesPipeline

* adjust compat
This commit is contained in:
Simon Christ
2022-01-12 15:30:52 +01:00
committed by GitHub
parent b1c11cca33
commit a24fb93ab1
5 changed files with 35 additions and 4 deletions
+8
View File
@@ -12,6 +12,14 @@ end
empty!(PLOTS_DEFAULTS)
Plots.__init__()
@testset "default" begin
default(fillrange=0)
@test Plots._series_defaults[:fillrange] == 0
pl = plot(1:5)
@test pl[1][1][:fillrange] == 0
default()
end
@testset "Legend defaults" begin
p = plot()
@test p[1][:legend_font_family] == "sans-serif"
+11
View File
@@ -17,3 +17,14 @@ end
@test all(RecipesPipeline.get_axis_limits(p1, :x) .== x)
@test all(RecipesPipeline.get_axis_limits(p2, :x) .== x)
end
@testset "Slicing" begin
@test plot(1:5, fillrange = 0)[1][1][:fillrange] == 0
data4 = rand(4,4)
for i in axes(data4, 1)
@test plot(data4, fillrange = 0)[1][i][:fillrange] == 0
@test plot(data4, fillrange = [1, 2])[1][i][:fillrange] == [1.0, 2.0]
@test plot(data4, fillrange = [1 2])[1][i][:fillrange] == (iseven(i) ? 2 : 1)
end
end