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:
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user