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

StackOverflowError using Type as colour #1574

Open
evan-wehi opened this issue Mar 15, 2022 · 0 comments
Open

StackOverflowError using Type as colour #1574

evan-wehi opened this issue Mar 15, 2022 · 0 comments

Comments

@evan-wehi
Copy link

using Gadfly
df = DataFrame(x=[1, 2], y=[1, 2], colour=[Int, Float64])
plot(df, x=:x, y=:y, color=:colour, Geom.line)

produces

Error showing value of type Gadfly.Plot:
ERROR: StackOverflowError:
Stacktrace:
     [1] parse_colorant(c::Type)
       @ Compose ~/.julia/packages/Compose/h4MDD/src/Compose.jl:45
     [2] (::Compose.var"#1#2")(x::Type)
       @ Compose ./none:0
     [3] iterate(::Base.Generator{Tuple{DataType}, Compose.var"#1#2"})
       @ Base ./generator.jl:47
     [4] collect(itr::Base.Generator{Tuple{DataType}, Compose.var"#1#2"})
       @ Base ./array.jl:724
     [5] parse_colorant(c::Tuple{DataType})
       @ Compose ~/.julia/packages/Compose/h4MDD/src/Compose.jl:44
--- the last 5 lines are repeated 8369 more times ---
 [41851] parse_colorant(c::Type)
       @ Compose ~/.julia/packages/Compose/h4MDD/src/Compose.jl:45
 [41852] (::Compose.var"#48#49")(c::Type)
       @ Compose ./none:0
 [41853] iterate
       @ ./generator.jl:47 [inlined]
 [41854] collect
       @ ./array.jl:724 [inlined]
 [41855] stroke(cs::Vector{DataType})
       @ Compose ~/.julia/packages/Compose/h4MDD/src/property.jl:56
 [41856] render(geom::Gadfly.Geom.LineGeometry, theme::Theme, aes::Gadfly.Aesthetics)
       @ Gadfly.Geom ~/.julia/packages/Gadfly/B5yQc/src/geom/line.jl:154
 [41857] render(geom::Gadfly.Geom.LineGeometry, theme::Theme, aes::Gadfly.Aesthetics, subplot_layer_aess::Vector{Gadfly.Aesthetics}, subplot_layer_datas::Vector{Gadfly.Data}, scales::Dict{Symbol, Gadfly.ScaleElement})
       @ Gadfly.Geom ~/.julia/packages/Gadfly/B5yQc/src/geometry.jl:45
 [41858] (::Gadfly.var"#128#130"{Dict{Symbol, Gadfly.ScaleElement}})(::Tuple{Gadfly.Layer, Gadfly.Aesthetics, Vector{Gadfly.Aesthetics}, Vector{Gadfly.Data}, Theme})
       @ Gadfly ./none:0
 [41859] iterate
       @ ./generator.jl:47 [inlined]
 [41860] collect(itr::Base.Generator{Base.Iterators.Zip{Tuple{Vector{Gadfly.Layer}, Vector{Gadfly.Aesthetics}, Vector{Vector{Gadfly.Aesthetics}}, Vector{Vector{Gadfly.Data}}, Vector{Theme}}}, Gadfly.var"#128#130"{Dict{Symbol, Gadfly.ScaleElement}}})
       @ Base ./array.jl:724
 [41861] render_prepared(plot::Gadfly.Plot, coord::Gadfly.Coord.Cartesian, plot_aes::Gadfly.Aesthetics, layer_aess::Vector{Gadfly.Aesthetics}, layer_stats::Vector{Vector{Gadfly.StatisticElement}}, layer_subplot_aess::Vector{Vector{Gadfly.Aesthetics}}, layer_subplot_datas::Vector{Vector{Gadfly.Data}}, scales::Dict{Symbol, Gadfly.ScaleElement}, guides::Vector{Gadfly.GuideElement}; table_only::Bool, dynamic::Bool)
       @ Gadfly ~/.julia/packages/Gadfly/B5yQc/src/Gadfly.jl:802
 [41862] render_prepared(plot::Gadfly.Plot, coord::Gadfly.Coord.Cartesian, plot_aes::Gadfly.Aesthetics, layer_aess::Vector{Gadfly.Aesthetics}, layer_stats::Vector{Vector{Gadfly.StatisticElement}}, layer_subplot_aess::Vector{Vector{Gadfly.Aesthetics}}, layer_subplot_datas::Vector{Vector{Gadfly.Data}}, scales::Dict{Symbol, Gadfly.ScaleElement}, guides::Vector{Gadfly.GuideElement})
       @ Gadfly ~/.julia/packages/Gadfly/B5yQc/src/Gadfly.jl:794
 [41863] render(plot::Gadfly.Plot)
       @ Gadfly ~/.julia/packages/Gadfly/B5yQc/src/Gadfly.jl:740
 [41864] draw
       @ ~/.julia/packages/Gadfly/B5yQc/src/Gadfly.jl:843 [inlined]
 [41865] show(io::IOBuffer, m::MIME{Symbol("text/html")}, p::Gadfly.Plot)
       @ Gadfly ~/.julia/packages/Gadfly/B5yQc/src/Gadfly.jl:933
 [41866] show(io::IOBuffer, m::String, x::Gadfly.Plot)
       @ Base.Multimedia ./multimedia.jl:111
 [41867] display(d::VSCodeServer.InlineDisplay, m::MIME{Symbol("juliavscode/html")}, x::Gadfly.Plot)
       @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.5.11/scripts/packages/VSCodeServer/src/display.jl:0
 [41868] display(d::VSCodeServer.InlineDisplay, mime::String, x::Any)
       @ Base.Multimedia ./multimedia.jl:216
 [41869] display(d::VSCodeServer.InlineDisplay, x::Gadfly.Plot)
       @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.5.11/scripts/packages/VSCodeServer/src/display.jl:156
 [41870] display(x::Any)
       @ Base.Multimedia ./multimedia.jl:328
 [41871] print_response(errio::IO, response::Any, show_value::Bool, have_color::Bool, specialdisplay::Union{Nothing, AbstractDisplay})
       @ REPL ~/Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/REPL/src/REPL.jl:0
 [41872] (::REPL.var"#45#46"{REPL.LineEditREPL, Pair{Any, Bool}, Bool, Bool})(io::Any)
       @ REPL ~/Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/REPL/src/REPL.jl:275
 [41873] with_repl_linfo(f::Any, repl::REPL.LineEditREPL)
       @ REPL ~/Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/REPL/src/REPL.jl:508
 [41874] print_response(repl::REPL.AbstractREPL, response::Any, show_value::Bool, have_color::Bool)
       @ REPL ~/Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/REPL/src/REPL.jl:273
 [41875] (::REPL.var"#do_respond#66"{Bool, Bool, REPL.var"#77#87"{REPL.LineEditREPL, REPL.REPLHistoryProvider}, REPL.LineEditREPL, REPL.LineEdit.Prompt})(s::REPL.LineEdit.MIState, buf::Any, ok::Bool)
       @ REPL ~/Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/REPL/src/REPL.jl:844
 [41876] #invokelatest#2
       @ ./essentials.jl:716 [inlined]
 [41877] invokelatest
       @ ./essentials.jl:714 [inlined]
 [41878] run_interface(terminal::REPL.Terminals.TextTerminal, m::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
       @ REPL.LineEdit ~/Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/REPL/src/LineEdit.jl:2493
 [41879] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
       @ REPL ~/Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/REPL/src/REPL.jl:1230

Workaround is to convert the Type to a string.

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

1 participant