Merge pull request #1667 from pfitzseb/sp/betterdisplay
WIP: Actually use PlotsDisplay()
This commit is contained in:
commit
9b6fc4bc6b
14
src/Plots.jl
14
src/Plots.jl
@ -293,18 +293,4 @@ end
|
|||||||
|
|
||||||
const CURRENT_BACKEND = CurrentBackend(:none)
|
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
|
|
||||||
end
|
|
||||||
|
|
||||||
# ---------------------------------------------------------
|
|
||||||
|
|
||||||
end # module
|
end # module
|
||||||
|
|||||||
17
src/init.jl
17
src/init.jl
@ -1,4 +1,21 @@
|
|||||||
function __init__()
|
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())
|
||||||
|
|
||||||
|
atreplinit(i -> begin
|
||||||
|
if PlotDisplay() in Base.Multimedia.displays
|
||||||
|
popdisplay(PlotsDisplay())
|
||||||
|
end
|
||||||
|
pushdisplay(PlotsDisplay())
|
||||||
|
end)
|
||||||
|
|
||||||
include(joinpath(@__DIR__, "backends", "plotly.jl"))
|
include(joinpath(@__DIR__, "backends", "plotly.jl"))
|
||||||
include(joinpath(@__DIR__, "backends", "gr.jl"))
|
include(joinpath(@__DIR__, "backends", "gr.jl"))
|
||||||
include(joinpath(@__DIR__, "backends", "web.jl"))
|
include(joinpath(@__DIR__, "backends", "web.jl"))
|
||||||
|
|||||||
@ -145,11 +145,6 @@ function Base.display(::PlotsDisplay, plt::Plot)
|
|||||||
_display(plt)
|
_display(plt)
|
||||||
end
|
end
|
||||||
|
|
||||||
# override the REPL display to open a gui window
|
|
||||||
using REPL
|
|
||||||
Base.display(::REPL.REPLDisplay, ::MIME"text/plain", plt::Plot) = gui(plt)
|
|
||||||
|
|
||||||
|
|
||||||
_do_plot_show(plt, showval::Bool) = showval && gui(plt)
|
_do_plot_show(plt, showval::Bool) = showval && gui(plt)
|
||||||
function _do_plot_show(plt, showval::Symbol)
|
function _do_plot_show(plt, showval::Symbol)
|
||||||
showval == :gui && gui(plt)
|
showval == :gui && gui(plt)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user