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

Plotting a ribbon with a tuple of vectors no longer works #2185

Closed
asinghvi17 opened this issue Sep 12, 2019 · 3 comments · Fixed by #2186
Closed

Plotting a ribbon with a tuple of vectors no longer works #2185

asinghvi17 opened this issue Sep 12, 2019 · 3 comments · Fixed by #2186
Labels

Comments

@asinghvi17
Copy link
Member

MWE:

using Plots
plot([0, 1], [1, 1]; ribbon = ([1, 2], [3, 4]))

ERROR: Cannot convert Tuple{Array{Int64,1},Array{Int64,1}} to series data for plotting
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] prepareSeriesData(::Tuple{Array{Int64,1},Array{Int64,1}}) at /Users/anshul/.julia/dev/Plots/src/series.jl:15
 [3] convertToAnyVector(::Tuple{Array{Int64,1},Array{Int64,1}}, ::Dict{Symbol,Any}) at /Users/anshul/.julia/dev/Plots/src/series.jl:26
 [4] process_ribbon(::Tuple{Array{Int64,1},Array{Int64,1}}, ::Dict{Symbol,Any}) at /Users/anshul/.julia/dev/Plots/src/series.jl:62
 [5] macro expansion at /Users/anshul/.julia/dev/Plots/src/series.jl:139 [inlined]
 [6] apply_recipe(::Dict{Symbol,Any}, ::Type{Plots.SliceIt}, ::Array{Int64,1}, ::Array{Int64,1}, ::Nothing) at /Users/anshul/.julia/packages/RecipesBase/zBoFG/src/RecipesBase.jl:275
 [7] _process_userrecipes(::Plots.Plot{Plots.GRBackend}, ::Dict{Symbol,Any}, ::Tuple{Array{Int64,1},Array{Int64,1}}) at /Users/anshul/.julia/dev/Plots/src/pipeline.jl:83
 [8] _plot!(::Plots.Plot{Plots.GRBackend}, ::Dict{Symbol,Any}, ::Tuple{Array{Int64,1},Array{Int64,1}}) at /Users/anshul/.julia/dev/Plots/src/plot.jl:178
 [9] #plot#133(::Base.Iterators.Pairs{Symbol,Tuple{Array{Int64,1},Array{Int64,1}},Tuple{Symbol},NamedTuple{(:ribbon,),Tuple{Tuple{Array{Int64,1},Array{Int64,1}}}}}, ::typeof(plot), ::Array{Int64,1}, ::Vararg{Array{Int64,1},N} where N) at /Users/anshul/.julia/dev/Plots/src/plot.jl:57
 [10] (::RecipesBase.var"#kw##plot")(::NamedTuple{(:ribbon,),Tuple{Tuple{Array{Int64,1},Array{Int64,1}}}}, ::typeof(plot), ::Array{Int64,1}, ::Array{Int64,1}) at /Users/anshul/.julia/dev/Plots/src/plot.jl:51
 [11] top-level scope at REPL[17]:100:

cc @daschw @yha (since you seem to have worked with that code recently)

@asinghvi17 asinghvi17 added the bug label Sep 12, 2019
@asinghvi17
Copy link
Member Author

asinghvi17 commented Sep 12, 2019

Interesting...from the stacktrace, it seems to be hitting

process_ribbon(ribbon, plotattributes) = convertToAnyVector(ribbon, plotattributes)

and not
process_ribbon(ribbon::Tuple{Any,Any}) = collect(zip(convertToAnyVector(ribbon[1], plotattributes),

Edit: well yeah duh

@yanivabir
Copy link

yanivabir commented Nov 19, 2019

This is still not working for me:

(v1.2) pkg> status Plots
    Status `~/.julia/environments/v1.2/Project.toml`
  [682c06a0] JSON v0.21.0
  [91a5bcdd] Plots v0.27.0
  [2913bbd2] StatsBase v0.32.0
  [10745b16] Statistics

plot([0, 1], [1, 1]; ribbon = ([1, 2], [3, 4]))

ERROR: Cannot convert Tuple{Array{Int64,1},Array{Int64,1}} to series data for plotting
Stacktrace:
 [1] prepareSeriesData(::Tuple{Array{Int64,1},Array{Int64,1}}) at /Users/yanivabir/.julia/packages/Plots/Iuc9S/src/series.jl:15
 [2] convertToAnyVector(::Tuple{Array{Int64,1},Array{Int64,1}}, ::Dict{Symbol,Any}) at /Users/yanivabir/.julia/packages/Plots/Iuc9S/src/series.jl:26
 [3] process_ribbon(::Tuple{Array{Int64,1},Array{Int64,1}}, ::Dict{Symbol,Any}) at /Users/yanivabir/.julia/packages/Plots/Iuc9S/src/series.jl:62
 [4] macro expansion at /Users/yanivabir/.julia/packages/Plots/Iuc9S/src/series.jl:139 [inlined]
 [5] apply_recipe(::Dict{Symbol,Any}, ::Type{Plots.SliceIt}, ::Array{Int64,1}, ::Array{Int64,1}, ::Nothing) at /Users/yanivabir/.julia/packages/RecipesBase/zBoFG/src/RecipesBase.jl:275
 [6] _process_userrecipes(::Plots.Plot{Plots.GRBackend}, ::Dict{Symbol,Any}, ::Tuple{Array{Int64,1},Array{Int64,1}}) at /Users/yanivabir/.julia/packages/Plots/Iuc9S/src/pipeline.jl:83
 [7] _plot!(::Plots.Plot{Plots.GRBackend}, ::Dict{Symbol,Any}, ::Tuple{Array{Int64,1},Array{Int64,1}}) at /Users/yanivabir/.julia/packages/Plots/Iuc9S/src/plot.jl:178
 [8] #plot#137(::Base.Iterators.Pairs{Symbol,Tuple{Array{Int64,1},Array{Int64,1}},Tuple{Symbol},NamedTuple{(:ribbon,),Tuple{Tuple{Array{Int64,1},Array{Int64,1}}}}}, ::typeof(plot), ::Array{Int64,1}, ::Vararg{Array{Int64,1},N} where N) at /Users/yanivabir/.julia/packages/Plots/Iuc9S/src/plot.jl:57
 [9] (::getfield(RecipesBase, Symbol("#kw##plot")))(::NamedTuple{(:ribbon,),Tuple{Tuple{Array{Int64,1},Array{Int64,1}}}}, ::typeof(plot), ::Array{Int64,1}, ::Array{Int64,1}) at ./none:0
 [10] top-level scope at none:0

@fredcallaway
Copy link
Contributor

@yanivabir
You need the most recent version: v0.27.1

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

Successfully merging a pull request may close this issue.

3 participants