JuliaPlots / JuliaPlots/PlotlyJS.jl

GenericTrace savefig error

Open
#304 1 comment 0 reactions 0 assignees View on GitHub
help wanted
Dominant language
Julia
Stars
444
Forks
86
PR merge metrics
No merged PRs in 30d

Description

I am trying to plot a series of boxplot following http://spencerlyon.com/PlotlyJS.jl/examples/box_plots/ and export it to a static file. However, I am getting errors running the following code:

**Code**
```
using PlotlyJS
using Blink
using ORCA
using JuliaDB
using JuliaDBMeta

plot_traces = GenericTrace[]
for keys in collect(keys(boxplot_dict))

boxplot = box(; name = boxplot_dict[keys]["name"], # Specify trace name
y = boxplot_dict[keys]["data"], # Specify trace data
text = boxplot_dict[keys]["hover"], # Specify Hovertext data
hoverinfo = "y+text" # Hover data displayed
)
push!(plot_traces, boxplot)
end

plot(plot_traces, style = boxplot_style)
PlotlyJS.savefig(plot_traces, "test.pdf")
```

However, I keep getting this error regardless of the file format.

**Error**
```
ERROR: MethodError: no method matching savefig(::Array{GenericTrace,1}, ::String)
Closest candidates are:
savefig(::Plot, ::AbstractString; format, scale, width, height) at /home/jmb/.julia/packages/ORCA/xULYl/src/ORCA.jl:66
savefig(::Union{PlotlyJS.SyncPlot, Plot}, ::AbstractString, ::Any...) at /home/jmb/.julia/packages/PlotlyJS/b9Efu/src/PlotlyJS.jl:49
savefig(::PlotlyJS.SyncPlot, ::Any...; k...) at /home/jmb/.julia/packages/PlotlyJS/b9Efu/src/savefig_orca.jl:1
Stacktrace:
[1] top-level scope at none:0
```

**Julia version**
```
versioninfo()
Julia Version 1.4.0-DEV.581
Commit cb8e1cfa4e (2019-12-11 18:42 UTC)
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-8.0.1 (ORCJIT, skylake)
Environment:
JULIA_NUM_THREADS = 4
```

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.