JuliaPlots / JuliaPlots/PlotlyJS.jl

PlotlyJS.savefig (v0.18.8) not working on M1 mac running Julia 1.7-1.9 (arm64)

Open
#424 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
Julia
Stars
444
Forks
86
PR merge metrics
No merged PRs in 30d

Description

When I tried to save a jpeg figure using PlotlyJS, it fails on M1 mac running Julia v1.7. The same example runs fine on a Intel mac:

```
using PlotlyJS

function linescatter1()
trace1 = scatter(;x=1:4, y=[10, 15, 13, 17], mode="markers")
plot([trace1])
end
linescatter1()

testio = open("test.jpg", "w")
PlotlyJS.savefig(testio, linescatter1(); format="jpeg");
close(testio)
```

The error output is:
```
julia> PlotlyJS.savefig(testio, linescatter1(); format="jpeg");
┌ Warning: Kaleido is not available on this system. Julia will be unable to save images of any plots.
└ @ PlotlyJS ~/.julia/packages/PlotlyJS/4jzLr/src/kaleido.jl:65
┌ Warning: UndefVarError(:artifact_dir)
└ @ PlotlyJS ~/.julia/packages/PlotlyJS/4jzLr/src/kaleido.jl:66
ERROR: UndefRefError: access to undefined reference
Stacktrace:
[1] getproperty
@ ./Base.jl:42 [inlined]
[2] savefig(p::Plot{Vector{GenericTrace{Dict{Symbol, Any}}}, Layout{Dict{Symbol, Any}}, Vector{PlotlyFrame}}; width::Nothing, height::Nothing, scale::Nothing, format::String)
@ PlotlyJS ~/.julia/packages/PlotlyJS/4jzLr/src/kaleido.jl:98
[3] savefig(p::PlotlyJS.SyncPlot; kwargs::Base.Pairs{Symbol, Union{Nothing, String}, NTuple{4, Symbol}, NamedTuple{(:width, :height, :scale, :format), Tuple{Nothing, Nothing, Nothing, String}}})
@ PlotlyJS ~/.julia/packages/PlotlyJS/4jzLr/src/kaleido.jl:71
[4] savefig(io::IOStream, p::PlotlyJS.SyncPlot; width::Nothing, height::Nothing, scale::Nothing, format::String)
@ PlotlyJS ~/.julia/packages/PlotlyJS/4jzLr/src/kaleido.jl:154
[5] top-level scope
@ REPL[29]:1
```

```
julia> versioninfo()
Julia Version 1.7.0
Commit 3bf9d17731 (2021-11-30 12:12 UTC)
Platform Info:
OS: macOS (arm64-apple-darwin21.1.0)
CPU: Apple M1
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-12.0.1 (ORCJIT, cyclone)
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.