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

Series Makie plot for more than seven elements is broken #552

Closed
felixcremer opened this issue Oct 13, 2023 · 2 comments
Closed

Series Makie plot for more than seven elements is broken #552

felixcremer opened this issue Oct 13, 2023 · 2 comments
Labels

Comments

@felixcremer
Copy link
Contributor

While running the tests I got the following error.
I am not sure, whether this is basically a user error and we should change the test or whether we would like to change the behaviour if the number of categories in the other dimension would be higher than the number of colors we have available.

    A2r = rand(Y(10:10:100), X(['a', 'b', 'c']))
ssssssssssssssssssssssssssssssss
julia>     fig, ax, _ = M.series(A2r; labeldim=Y)
ERROR: Not enough colors for number of categories. Categories: 10, colors: 7
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] categorical_colors
    @ ~/.julia/packages/Makie/NrrbP/src/conversions.jl:1222 [inlined]
  [3] categorical_colors(cs::Symbol, categories::Int64)
    @ Makie ~/.julia/packages/Makie/NrrbP/src/conversions.jl:1237
  [4] (::Makie.var"#2121#2129"{Int64})(color::Symbol, scolor::Nothing)
    @ Makie ~/.julia/packages/Makie/NrrbP/src/basic_recipes/series.jl:74
  [5] #map#157
    @ ~/.julia/packages/Makie/NrrbP/src/scenes.jl:185 [inlined]
  [6] map(f::Makie.var"#2121#2129"{Int64}, scene::Combined{Makie.series, Tuple{Vector{Vector{Point{2, Float32}}}}}, arg1::Observable{Any}, args::Observable{Any})
    @ Makie ~/.julia/packages/Makie/NrrbP/src/scenes.jl:182
  [7] plot!(plot::Combined{Makie.series, Tuple{Vector{Vector{Point{2, Float32}}}}})
    @ Makie ~/.julia/packages/Makie/NrrbP/src/basic_recipes/series.jl:72
  [8] plot!(scene::Scene, P::Type{Combined{Makie.series, Tuple{DimensionalData.Dimensions.LookupArrays.NoLookup{Base.OneTo{Int64}}, Matrix{Float64}}}}, attributes::Attributes, input::Tuple{Observable{DimensionalData.Dimensions.LookupArrays.NoLookup{Base.OneTo{Int64}}}, Observable{Matrix{Float64}}}, args::Observable{Tuple{Vector{Vector{Point{2, Float32}}}}})
    @ Makie ~/.julia/packages/Makie/NrrbP/src/interfaces.jl:398
  [9] plot!(::Scene, ::Type{Combined{Makie.series}}, ::Attributes, ::DimensionalData.Dimensions.LookupArrays.NoLookup{Base.OneTo{Int64}}, ::Vararg{Any}; kw_attributes::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Makie ~/.julia/packages/Makie/NrrbP/src/interfaces.jl:310
 [10] plot!(::Scene, ::Type{Combined{Makie.series}}, ::Attributes, ::DimensionalData.Dimensions.LookupArrays.NoLookup{Base.OneTo{Int64}}, ::Matrix{Float64})
    @ Makie ~/.julia/packages/Makie/NrrbP/src/interfaces.jl:275
 [11] get_axis(fig::Any, P::Any, axis_kw::Dict, plot_attr::Any, plot_args::Any)
    @ Makie ~/.julia/packages/Makie/NrrbP/src/figureplotting.jl:43
 [12] plot(::Type{Combined{Makie.series}}, ::DimensionalData.Dimensions.LookupArrays.NoLookup{Base.OneTo{Int64}}, ::Vararg{Any}; axis::Attributes, figure::NamedTuple{(), Tuple{}}, kw_attributes::Base.Pairs{Symbol, Any, Tuple{Symbol, Symbol, Symbol}, NamedTuple{(:color, :colormap, :labels), Tuple{Vector{ColorTypes.RGBA{Float32}}, Symbol, Observable{Any}}}})
    @ Makie ~/.julia/packages/Makie/NrrbP/src/figureplotting.jl:62
 [13] plot
    @ ~/.julia/packages/Makie/NrrbP/src/figureplotting.jl:55 [inlined]
 [14] #series#2109
    @ ~/.julia/packages/MakieCore/7iPhv/src/recipes.jl:35 [inlined]
 [15] series(A::DimArray{Float64, 2, Tuple{Y{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, StepRange{Int64, Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}, X{DimensionalData.Dimensions.LookupArrays.Categorical{Char, Vector{Char}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, Tuple{}, Matrix{Float64}, DimensionalData.NoName, DimensionalData.Dimensions.LookupArrays.NoMetadata}; colormap::Symbol, color::Nothing, axislegendkw::NamedTuple{(), Tuple{}}, labeldim::Type, attributes::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ DimensionalDataMakie ~/.julia/dev/DimensionalData/ext/DimensionalDataMakie.jl:251
 [16] top-level scope
    @ REPL[174]:1
@felixcremer
Copy link
Contributor Author

This seems to be a Makie regression because series is ignoring the color keyword.
See MakieOrg/Makie.jl#3301

@felixcremer
Copy link
Contributor Author

felixcremer commented Oct 17, 2023

This is fixed now on Makie master. So we can close this as soon as there is a new version for Makie tagged. If we do so, we should uncomment the Makie.series tests in tests/plotrecipes.jl

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.

2 participants