From 6593e3cfe6d1f99b2404524c7d86dce260671d2a Mon Sep 17 00:00:00 2001 From: Sebastian Pfitzner Date: Thu, 16 Aug 2018 12:23:23 +0200 Subject: [PATCH] actually use __init__ --- src/Plots.jl | 15 --------------- src/init.jl | 10 ++++++++++ 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/src/Plots.jl b/src/Plots.jl index ac99a187..d63282f9 100644 --- a/src/Plots.jl +++ b/src/Plots.jl @@ -294,19 +294,4 @@ end const CURRENT_BACKEND = CurrentBackend(:none) -# for compatibility with Requires.jl: -@init begin - if isdefined(Main, :PLOTS_DEFAULTS) - if haskey(Main.PLOTS_DEFAULTS, :theme) - theme(Main.PLOTS_DEFAULTS[:theme]) - end - for (k,v) in Main.PLOTS_DEFAULTS - k == :theme || default(k, v) - end - end - pushdisplay(PlotsDisplay()) -end - -# --------------------------------------------------------- - end # module diff --git a/src/init.jl b/src/init.jl index 53f5898b..51865535 100644 --- a/src/init.jl +++ b/src/init.jl @@ -1,4 +1,14 @@ function __init__() + if isdefined(Main, :PLOTS_DEFAULTS) + if haskey(Main.PLOTS_DEFAULTS, :theme) + theme(Main.PLOTS_DEFAULTS[:theme]) + end + for (k,v) in Main.PLOTS_DEFAULTS + k == :theme || default(k, v) + end + end + pushdisplay(PlotsDisplay()) + include(joinpath(@__DIR__, "backends", "plotly.jl")) include(joinpath(@__DIR__, "backends", "gr.jl")) include(joinpath(@__DIR__, "backends", "web.jl"))