The next code forces julia to open a browser, and even though it doesn’t display anything there.
using Plots
plotly()
A = rand(5,5)
fig = heatmap(A)
display(fig)
When i switch to pyplot()
or gr()
it works properly and displays heatmap in a pane inside Juno.
Am I doing anything wrong?
versions info
julia> versioninfo()
Julia Version 1.0.0
Commit 5d4eaca0c9 (2018-08-08 20:58 UTC)
Platform Info:
OS: macOS (x86_64-apple-darwin14.5.0)
CPU: Intel(R) Core(TM) i5-4260U CPU @ 1.40GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-6.0.0 (ORCJIT, haswell)
Environment:
JULIA_NUM_THREADS = 2
(v1.0) pkg> status
Status `~/.julia/environments/v1.0/Project.toml`
[c52e3926] Atom v0.7.6
[6e4b80f9] BenchmarkTools v0.4.1
[159f3aea] Cairo v0.5.6
[b4f34e82] Distances v0.7.3
[5789e2e9] FileIO v1.0.1
[f6369f11] ForwardDiff v0.9.0
[4c0ca9eb] Gtk v0.16.4
[d9be37ee] Homebrew v0.7.0
[7073ff75] IJulia v1.12.0
[6218d12a] ImageMagick v0.7.1
[86fae568] ImageView v0.8.0
[916415d5] Images v0.16.0
[033835bb] JLD2 v0.1.2
[e5e0dc1b] Juno v0.5.3
[f0f68f2c] PlotlyJS v0.11.1
[91a5bcdd] Plots v0.20.2
[92933f4c] ProgressMeter v0.6.0
[d330b81b] PyPlot v2.6.3
[dca85d43] QuartzImageIO v0.5.0
[37e2e3b7] ReverseDiff v0.3.1
[295af30f] Revise v0.7.11
[90137ffa] StaticArrays v0.8.3
[b8865327] UnicodePlots v0.3.1
[1a1011a3] SharedArrays
[2f01184e] SparseArrays
Atom 1.30.0
Electron 2.0.5
Chrome 61.0.3163.100
Node v8.9.3
No, it’s just that barebones plotly always shows in the browser. Use plotlyjs instead if you want the plot pane.
2 Likes
Yeah, looks like this is the reason.
Nevertheless, when i switch to plotlyjs()
i get another error.
I should better post a new question about concrete error and post a link to solution here later.
Error
RROR: LoadError: type SyncPlot has no field view
Stacktrace:
[1] getproperty(::Any, ::Symbol) at ./sysimg.jl:18
[2] _create_backend_figure(::Plots.Plot{Plots.PlotlyJSBackend}) at /Users/user/.julia/packages/Plots/EJpx2/src/backends/plotlyjs.jl:15
[3] #invokelatest#1 at ./essentials.jl:686 [inlined]
[4] invokelatest at ./essentials.jl:685 [inlined]
[5] _plot_setup(::Plots.Plot{Plots.PlotlyJSBackend}, ::Dict{Symbol,Any}, ::Array{Dict{Symbol,Any},1}) at /Users/user/.julia/packages/Plots/EJpx2/src/pipeline.jl:215
[6] _plot!(::Plots.Plot{Plots.PlotlyJSBackend}, ::Dict{Symbol,Any}, ::Tuple{Array{Float64,1}}) at ./logging.jl:313
[7] #plot#132(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Array{Float64,1}) at /Users/user/.julia/packages/Plots/EJpx2/src/plot.jl:57
[8] plot(::Array{Float64,1}) at /Users/user/.julia/packages/Plots/EJpx2/src/plot.jl:51
[9] top-level scope at none:0
[10] include_string(::Module, ::String, ::String) at ./loading.jl:1002
[11] (::getfield(Atom, Symbol(“##118#123”)){String,String,Module})() at /Users/user/.julia/packages/Atom/WSz3k/src/eval.jl:120
[12] withpath(::getfield(Atom, Symbol(“##118#123”)){String,String,Module}, ::String) at /Users/user/.julia/packages/CodeTools/hB4Hy/src/utils.jl:30
[13] withpath at /Users/user/.julia/packages/Atom/WSz3k/src/eval.jl:46 [inlined]
[14] #117 at /Users/user/.julia/packages/Atom/WSz3k/src/eval.jl:117 [inlined]
[15] hideprompt(::getfield(Atom, Symbol(“##117#122”)){String,String,Module}) at /Users/user/.julia/packages/Atom/WSz3k/src/repl.jl:76
[16] macro expansion at /Users/user/.julia/packages/Atom/WSz3k/src/eval.jl:116 [inlined]
[17] (::getfield(Atom, Symbol(“##116#121”)){Dict{String,Any}})() at ./task.jl:85
in expression starting at /Users/user/Programming/science/topography/julia/matrix_approach.jl:12
On Win64, Julia-1.1.0 and all packages up-to-date, I see the following:
- Using PlotlyJS directly, an Electron window pops up
- Using PlotlyJS as a Plots backend, a static version of the plot appears in the plot pane, not the interactive clickable version.
I did some reading on this and came across an issue blaming this on a bug in WebIO. Has there been any progress in this area?