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

Visualization notebook throws an error when annotating both sides of violin plots #34

Open
daviddoji opened this issue Jun 23, 2021 · 1 comment

Comments

@daviddoji
Copy link

When executing the last cell of the "Plot 1: Symmetric violin plots and annotations" section, the notebook throws the following error:

MethodError: no method matching Shape(::Vector{Any}, ::Vector{Any})
Closest candidates are:
  Shape(::AbstractVector{T} where T) at /opt/julia/packages/Plots/FKcum/src/components.jl:30

Stacktrace:
 [1] top-level scope
   @ In[15]:23
 [2] eval
   @ ./boot.jl:360 [inlined]
 [3] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
   @ Base ./loading.jl:1094

I'm using Julia 1.6.0. Same happens to you apparently :)

@DarioSlaifsteinSk
Copy link

You need to erase/comment the following lines:
plot!(Shape([],[]),color=6,label=yi)
the Shape method there doesn't work anymore.
my workaround to plot the legend correctly was:

years_of_interst = ["2010-02","2020-02"]
...
 if si==states_of_interest[end]
      violin!([si], curprices,alpha=0.8,side=:right,color=7,label=yi)
 else
        violin!([si], curprices,alpha=0.8,side=:right,color=7,label="")
 end

same for the other year. Check that I changed the type of the year_of_interest so that the label kwarg works.

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