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:
parent
2ef13c19ea
commit
363f401474
@ -15,9 +15,10 @@ end
|
|||||||
function __init__()
|
function __init__()
|
||||||
user_defaults = _plots_defaults()
|
user_defaults = _plots_defaults()
|
||||||
if haskey(user_defaults, :theme)
|
if haskey(user_defaults, :theme)
|
||||||
theme(pop!(user_defaults, :theme))
|
theme(pop!(user_defaults, :theme); user_defaults...)
|
||||||
end
|
else
|
||||||
default(; user_defaults...)
|
default(; user_defaults...)
|
||||||
|
end
|
||||||
|
|
||||||
insert!(Base.Multimedia.displays, findlast(x -> x isa Base.TextDisplay || x isa REPL.REPLDisplay, Base.Multimedia.displays) + 1, PlotsDisplay())
|
insert!(Base.Multimedia.displays, findlast(x -> x isa Base.TextDisplay || x isa REPL.REPLDisplay, Base.Multimedia.displays) + 1, PlotsDisplay())
|
||||||
|
|
||||||
|
|||||||
@ -11,6 +11,7 @@ import GeometryTypes, GeometryBasics
|
|||||||
using Dates
|
using Dates
|
||||||
using RecipesBase
|
using RecipesBase
|
||||||
|
|
||||||
|
include("test_defaults.jl")
|
||||||
include("test_axes.jl")
|
include("test_axes.jl")
|
||||||
include("test_axis_letter.jl")
|
include("test_axis_letter.jl")
|
||||||
include("test_recipes.jl")
|
include("test_recipes.jl")
|
||||||
|
|||||||
11
test/test_defaults.jl
Normal file
11
test/test_defaults.jl
Normal 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__()
|
||||||
Loading…
x
Reference in New Issue
Block a user