# PlotlyJS GenericTrace Error

**URL:** <https://discourse.julialang.org/t/plotlyjs-generictrace-error/32243>\
**Category:** General Usage\
**Tags:** plotting\
**Created:** [December 13, 2019, 6:58pm UTC](https://discourse.julialang.org/t/plotlyjs-generictrace-error/32243 "2019-12-13T18:58:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alphasig329](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alphasig329/32/9794_2.png) [@alphasig329](https://discourse.julialang.org/u/alphasig329)\
**Post date:** [December 13, 2019, 6:58pm UTC](https://discourse.julialang.org/t/plotlyjs-generictrace-error/32243/1 "2019-12-13T18:58:20Z")

</div>

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

```julia
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 the error

```julia
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

```

Are there any suggestions? I submitted a ticket with PlotlyJS.jl

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [December 13, 2019, 7:03pm UTC](https://discourse.julialang.org/t/plotlyjs-generictrace-error/32243/2 "2019-12-13T19:03:46Z")

</div>

Shouldn’t you do

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

```

or something?

---

<div class="post-metadata">

**Author:** ![alphasig329](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alphasig329/32/9794_2.png) [@alphasig329](https://discourse.julialang.org/u/alphasig329)\
**Post date:** [December 13, 2019, 7:08pm UTC](https://discourse.julialang.org/t/plotlyjs-generictrace-error/32243/3 "2019-12-13T19:08:37Z")

</div>

Probably should have mentioned that I tried that

```julia
p = plot(plot_traces, style = boxplot_style)
PlotlyJS.savefig(p, "test.pdf")
ERROR: MethodError: savefig(::PlotlyJS.SyncPlot, ::String) is ambiguous. Candidates:
  savefig(p::Union{PlotlyJS.SyncPlot, Plot}, fn::AbstractString, args...) in PlotlyJS at /home/jmb/.julia/packages/PlotlyJS/b9Efu/src/PlotlyJS.jl:49
  savefig(p::PlotlyJS.SyncPlot, a...; k...) in PlotlyJS at /home/jmb/.julia/packages/PlotlyJS/b9Efu/src/savefig_orca.jl:1
Possible fix, define
  savefig(::PlotlyJS.SyncPlot, ::AbstractString, ::Vararg{Any,N} where N)
Stacktrace:
 [1] top-level scope at none:0

```

It feels like I am doing something wrong, but I cannot find any documentation similar to my problem.
