@davidanthoff from your previous code that worked perfectly:
df |>
@vlplot(:bar,
x=:Sex,
y=:Freq,
color=:Eye,
column={:haircut_woman, sort=["Red", "Blond", "Brown", "Black"]}
)
I’m trying exactly as above to sort for color as well. If I run:
df |>
@vlplot(:bar,
x=:Sex,
y=:Freq,
color={:Eye, sort=["Green", "Blue", "Hazel", "Brown"]},
column={:haircut_woman, sort=["Red", "Blond", "Brown", "Black"]}
)
I end up getting that the legend shows the new ordering that I specified, however the actual ordering of the stack remains the same (and colors change now for some other reason). If I try putting this in the y={:Freq, sort=["Green", "Blue", "Hazel", "Brown"] }
, it doesn’t change anything either, and if I specify it only in the y without specifying it in the color, it goes back to the original sorting of “Blue, Brown, Green, Hazel” that it (alphabetically?) specified initially on its own. If I specify sort=true
with the color, it ignores my specified sorting and sorts by the dataframe specification which is unhelpful since I draw from various files to organise the data frame and this isn’t the ordering I’d want.
How do I sort this with color?