Plots.jl: empty plot with plotly in Firefox on Windows

Created on 6 Oct 2017  ·  19Comments  ·  Source: JuliaPlots/Plots.jl

Just trying to reproduce the first example in tutorial (and explicitly setting plotly() backend)

using Plots

julia> x = 1:10; y = rand(10); plotly()
Plots.PlotlyBackend()
julia> plot(x,y)

opens an empty page in Firefox (my default browser). Win10 here.

All 19 comments

Chrome works for me, but when I set Firefox as the default it is empty as well.

Works in Edge and IE. I'd call this Firefox-specific.

Sorry, my bad. I have no Plotly installed (Pkg.status() doesn't show it) but run plotly() it responds as if it was.

Plots.jl doesn't use the Plotly.jl package by default. It directly downloads the Plotly Javascript and builds browser pages from that. You can say that it's the one backend that's built into Plots.jl because of that.

Works great in Firefox on Mac. It appears to be an issue with the particular combination Plots, Plotly, Firefox and Windows 10 :scream:

It also works on Linux and Firefox.

It does not work on Firefox and Windows 7.

Can it be an issue with the firefox version? Works on 56 (on Linux) for me. @joa-quim what version are you using?

Was 55 but is the same with the just updated 56. They are 32 bits versions though, maybe that?

My Windows is 64-bit running an older version of Firefox, so I would be surprised if it's also 32-bit that's an issue.

I think the next thing to check is whether the developer console in Firefox is throwing an error.

OK, the console shows this.

Loading failed for the <script> with source “c:\j\.julia\v0.6\Plots\src\backends\..\..\deps\plotly-latest.min.js”.  jl_D12F.tmp.html:5
ReferenceError: Plotly is not defined[Learn More]  jl_D12F.tmp.html:11:5
The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol.

@joa-quim would you mind trying to use Plotly.jl in the same browser? It'd be nice to know if this is an issue with our setup.

Hmm, got these errors while Pkg.add("Plotly")

LoadError: LoadError: MethodError: Cannot `convert` an object of type String to an object of type __anon__.PlotlyJSSchemaDocsGenerator.SchemaAttribute
This may have arisen from a call to the constructor __anon__.PlotlyJSSchemaDocsGenerator.SchemaAttribute(...),
since type constructors fall back to convert methods.
while loading c:\j\.julia\v0.6\PlotlyJS\deps\make_schema_docs.jl, in expression starting on line 227
while loading c:\j\.julia\v0.6\PlotlyJS\deps\build.jl, in expression starting on line 6

=============================================================================================================================================================ERROR: UndefVarError: __anon__ not defined
julia> versioninfo()
Julia Version 0.6.0
Commit 903644385b* (2017-06-19 13:05 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.9.1 (ORCJIT, haswell)

Same here, Firefox shows empty window with the console outputting "ReferenceError: Plotly is not defined". Chrome works fine

Windows 10, Firefox Quantum 57.0b11 (64-bit)

P.S.: The install of Pkg.add("Plotly") fails with the same error as for @joa-quim. Otherwise identical versions.

Same problem here. I fixed it by prepending file:// to the plotly.js file location in the generated HTML, e.g., in @joa-quim's case above:

file://c:\j\.julia\v0.6\Plots\src\backends\..\..\deps\plotly-latest.min.js”

Then it works just fine in Firefox, IE and Chrome. If people could try this out on Mac and Linux I could have a make a PR ready to fix this soon.

@hessammehr if you show me exactly what you changed in the code, I can test it on linux. Alternatively you could just open a PR and we can test and discuss this there.

@daschw here's how I tested the PR:

using Plots
plotly()

p = plot([1, 2, 3])
open("out.html", "w") do f
    show(f, MIME("text/html"), p)
end

Works fine on Firefox/Chrome/IE/Edge on Windows.

Just tested this on Linux (Firefox and Chromium) and Mac (Firefox, Chrome, Safari) - seems to work fine there as well.

If this helps anyone: I had to disable the HTTPS EVERYWHERE extension in Firefox to get the Plotly

Related issues

mkborregaard picture mkborregaard  ·  3Comments

Cody-G picture Cody-G  ·  3Comments

Krastanov picture Krastanov  ·  3Comments

daschw picture daschw  ·  3Comments

cortner picture cortner  ·  4Comments