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

Move transforms do not respect requested scale order #3015

Open
mwaskom opened this issue Sep 12, 2022 · 0 comments
Open

Move transforms do not respect requested scale order #3015

mwaskom opened this issue Sep 12, 2022 · 0 comments

Comments

@mwaskom
Copy link
Owner

mwaskom commented Sep 12, 2022

When using a move like Stack or Dodge, the order of the levels does not change if a Nominal scale with explicit order is set for the variable. (The order of the mapping itself does change, so the plot is still correct, just maybe not what you wanted):

p = so.Plot(tips, x="time", color="smoker").add(so.Bar(), so.Hist(), so.Stack())
p

image

p.scale(color=so.Nominal(order=["Yes", "No"]))

image

This works differently in the function interface and so we probably want to have that be the default. Maybe we want to support different ordering for the move and the mapping? See also #2888

I believe this is a relatively easy fix because of our internal Groupby object with custom ordering logic. But the exact sequence of operations is a little bit unclear — will we always have the scale set up by the time we need to know the order of transform application?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant