Fix loading of themes (#3057)

* Fix loading of themes

Fix #3053 

Needs test

* Create test_defaults.jl

* Update runtests.jl

* Update test_defaults.jl

* Update test_defaults.jl

* Update test_defaults.jl

* Update test_defaults.jl

* Update test_defaults.jl
This commit is contained in:
Simon Christ
2020-10-12 17:25:40 +02:00
committed by GitHub
parent 2ef13c19ea
commit 363f401474
3 changed files with 15 additions and 2 deletions
+3 -2
View File
@@ -15,9 +15,10 @@ end
function __init__()
user_defaults = _plots_defaults()
if haskey(user_defaults, :theme)
theme(pop!(user_defaults, :theme))
theme(pop!(user_defaults, :theme); user_defaults...)
else
default(; user_defaults...)
end
default(; user_defaults...)
insert!(Base.Multimedia.displays, findlast(x -> x isa Base.TextDisplay || x isa REPL.REPLDisplay, Base.Multimedia.displays) + 1, PlotsDisplay())
+1
View File
@@ -11,6 +11,7 @@ import GeometryTypes, GeometryBasics
using Dates
using RecipesBase
include("test_defaults.jl")
include("test_axes.jl")
include("test_axis_letter.jl")
include("test_recipes.jl")
+11
View File
@@ -0,0 +1,11 @@
using Plots, Test
const PLOTS_DEFAULTS = Dict(:theme => :wong2)
Plots.__init__()
@testset "Loading theme" begin
@test plot(1:5)[1][1][:seriescolor] == RGBA(colorant"black")
end
empty!(PLOTS_DEFAULTS)
Plots.__init__()