Skip to content

Respect CategoricalArray order in group kwarg #1712

@kescobo

Description

@kescobo
l = CategoricalArray(repeat(["a", "c", "b"], 3))
levels!(l, ["a", "c", "b"])
c = [:red :blue :green]

scatter(rand(9), rand(9),
    group=l, # I want "c" to go second
    color=c) # I want "c" to be blue

levels1

Instead, "c" should be second, and be blue:

scatter(rand(9), rand(9), primary=false, color=repeat(vec(c), 3))
for i in eachindex(levels(l))
    scatter!([],[], label=levels(l)[i], color=c[i])
end

levels2

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementimproving existing functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions