Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] bar() doesn't work with plotly backend anymore #3364

Closed
shorca opened this issue Mar 22, 2021 · 2 comments · Fixed by #3742
Closed

[BUG] bar() doesn't work with plotly backend anymore #3364

shorca opened this issue Mar 22, 2021 · 2 comments · Fixed by #3742
Labels

Comments

@shorca
Copy link

shorca commented Mar 22, 2021

Details

bar(1:10) does not work with plotly() backend.

Backends

This bug occurs on ( insert x below )

Backend yes no untested
gr (default) x
pyplot x
plotly x
plotlyjs x
pgfplotsx x
inspectdr x

Versions

Plots.jl version: v1.11.0
Backend version (]st -m): PlotlyBase v0.4.3
Output of versioninfo():

Julia Version 1.5.4
Commit 69fcb5745b (2021-03-11 19:13 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-6850K CPU @ 3.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-9.0.1 (ORCJIT, broadwell)

MWE:

using Plots
plotly()
bar(1:10)

Result:

Error showing value of type Plots.Plot{Plots.PlotlyBackend}:
ERROR: UndefRefError: access to undefined reference
Stacktrace:
 [1] getindex at ./array.jl:809 [inlined]
 [2] iterate at ./array.jl:785 [inlined]
 [3] show_json(::JSON.Writer.PrettyContext{Base.GenericIOBuffer{Array{UInt8,1}}}, ::JSON.Serializations.StandardSerialization, ::Array{Any,1}) at /home/chunji/.julia/packages/JSON/3rsiS/src/Writer.jl:293
 [4] #show_json#3 at /home/chunji/.julia/packages/JSON/3rsiS/src/Writer.jl:325 [inlined]
 [5] print(::Base.GenericIOBuffer{Array{UInt8,1}}, ::Array{Any,1}, ::Int64) at /home/chunji/.julia/packages/JSON/3rsiS/src/Writer.jl:347
 [6] sprint(::Function, ::Array{Any,1}, ::Vararg{Any,N} where N; context::Nothing, sizehint::Int64) at ./strings/io.jl:105
 [7] sprint at ./strings/io.jl:101 [inlined]
 [8] json at /home/chunji/.julia/packages/JSON/3rsiS/src/Writer.jl:366 [inlined]
 [9] plotly_series_json at /home/chunji/.julia/packages/Plots/z5Msu/src/backends/plotly.jl:901 [inlined]
 [10] plotly_html_body(::Plots.Plot{Plots.PlotlyBackend}, ::Nothing) at /home/chunji/.julia/packages/Plots/z5Msu/src/backends/plotly.jl:949
 [11] plotly_html_body at /home/chunji/.julia/packages/Plots/z5Msu/src/backends/plotly.jl:924 [inlined]
 [12] html_body at /home/chunji/.julia/packages/Plots/z5Msu/src/backends/plotly.jl:906 [inlined]
 [13] #standalone_html#359 at /home/chunji/.julia/packages/Plots/z5Msu/src/backends/web.jl:7 [inlined]
 [14] write_temp_html(::Plots.Plot{Plots.PlotlyBackend}) at /home/chunji/.julia/packages/Plots/z5Msu/src/backends/web.jl:36
 [15] standalone_html_window(::Plots.Plot{Plots.PlotlyBackend}) at /home/chunji/.julia/packages/Plots/z5Msu/src/backends/web.jl:49
 [16] _display at /home/chunji/.julia/packages/Plots/z5Msu/src/backends/plotly.jl:992 [inlined]
 [17] display(::Plots.PlotsDisplay, ::Plots.Plot{Plots.PlotlyBackend}) at /home/chunji/.julia/packages/Plots/z5Msu/src/output.jl:150
 [18] display(::Any) at ./multimedia.jl:328
 [19] #invokelatest#1 at ./essentials.jl:710 [inlined]
 [20] invokelatest at ./essentials.jl:709 [inlined]
 [21] print_response(::IO, ::Any, ::Bool, ::Bool, ::Any) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/REPL/src/REPL.jl:238
 [22] print_response(::REPL.AbstractREPL, ::Any, ::Bool, ::Bool) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/REPL/src/REPL.jl:223
 [23] (::REPL.var"#do_respond#54"{Bool,Bool,REPL.var"#64#73"{REPL.LineEditREPL,REPL.REPLHistoryProvider},REPL.LineEditREPL,REPL.LineEdit.Prompt})(::Any, ::Any, ::Any) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/REPL/src/REPL.jl:822
 [24] #invokelatest#1 at ./essentials.jl:710 [inlined]
 [25] invokelatest at ./essentials.jl:709 [inlined]
 [26] run_interface(::REPL.Terminals.TextTerminal, ::REPL.LineEdit.ModalInterface, ::REPL.LineEdit.MIState) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/REPL/src/LineEdit.jl:2355
 [27] run_frontend(::REPL.LineEditREPL, ::REPL.REPLBackendRef) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/REPL/src/REPL.jl:1144
 [28] (::REPL.var"#38#42"{REPL.LineEditREPL,REPL.REPLBackendRef})() at ./task.jl:356
@shorca shorca added the bug label Mar 22, 2021
@niclasmattsson
Copy link

+1 for this and some more info: the problem seems to have been introduced in v1.11.0. Version v1.10.6 works for me, but not v1.11.0, v1.11.1 or master. Same behavior in Julia 1.5.4 and 1.6.0.

@niclasmattsson
Copy link

#3443 seems to fix this problem too, so thank you @yha.

At the risk of sounding entitled when I don't have time to help do the work myself: could the Plots devs please prioritize adding tests for basic functionality? Bar plots have been completely broken on Plotly & PlotlyJS backends over two minor Plots releases. Plots is one of the most important packages in Julia's ecosystem and when basic stuff breaks it's very confusing for Julia beginners and reflects badly on the language itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants