Skip to content

How to unsort groupedbar categories #437

@dmetivie

Description

@dmetivie

I am using groupedbar and I consider a case with a lot of group (namely more than ten), here is the github example with 12 groups:

a = 12
ctg = repeat(["Category 1", "Category 2"], inner = a)
nam = repeat("G" .* string.(1:a), outer = 2)

groupedbar(nam, rand(a, 2), group = ctg, xlabel = "Groups", ylabel = "Scores",
        title = "Scores by group and category", bar_width = 0.67,
        lw = 0, framestyle = :box)

image

As you can see the groups seem to be sorted which produces an unnatural look. How can we change that?
In fact, in my real case example, I have months instead of Gs and it does the same thing placing Ap, Aug, Dec, Feb, Jan instead of Jan, Feb, etc.

Is there an option like sort=:false?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions