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

Float32 arrays don't plot reliably on 0.5.0 #78

Closed
ssfrr opened this issue Sep 29, 2016 · 4 comments
Closed

Float32 arrays don't plot reliably on 0.5.0 #78

ssfrr opened this issue Sep 29, 2016 · 4 comments

Comments

@ssfrr
Copy link
Contributor

ssfrr commented Sep 29, 2016

It looks like Julia 0.5 changes the way that single-precision floating-point numbers are displayed in scientific notation. Instead of 3.05e-5 now it's 3.05f-5. Looks like if any of these show up in the data it hoses the display:

arr = Float32[-0.00735474, 3.05176f-5, 0.00769043]
plot(scatter(y=arr))

causes jupyter to say:

Javascript error adding output!
SyntaxError: Invalid or unexpected token
See your browser Javascript console for more details.

Related:
JuliaIO/JSON.jl#163
JuliaLang/julia#17720
JuliaLang/julia#18053
JuliaLang/julia#18682

Seems that it should be fixed in master, but hopefully it'll be backported to the next 0.5.x release. This probably shouldn't be worked-around in PlotlyJS, but I wanted to file the issue here in case somebody else came looking for an explanation of the error message.

@ssfrr ssfrr changed the title Float32 arrays don't plot reliably on 0.5 Float32 arrays don't plot reliably on 0.5.0 Sep 29, 2016
@sglyon
Copy link
Member

sglyon commented Sep 29, 2016

Thanks for letting is know here -- this is good to know.

Do you think it is an issue that can/should be resolved in JSON.jl?

@ssfrr
Copy link
Contributor Author

ssfrr commented Sep 30, 2016

OK. the fix PR just got merged into JSON.jl master. Hopefully it will be tagged pretty soon.

@ssfrr
Copy link
Contributor Author

ssfrr commented Sep 30, 2016

And now it's tagged and merged into METADATA. JSON version 0.7.1 should be good.

@ssfrr ssfrr closed this as completed Sep 30, 2016
@sglyon
Copy link
Member

sglyon commented Sep 30, 2016

Thanks for following up. Next time I tag plotlyjs I'll bump JSON in REQUIRE

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

No branches or pull requests

2 participants