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

Facets: order = 0 doesn't work as expected #923

Closed
alshan opened this issue Nov 7, 2023 · 0 comments
Closed

Facets: order = 0 doesn't work as expected #923

alshan opened this issue Nov 7, 2023 · 0 comments
Assignees

Comments

@alshan
Copy link
Collaborator

alshan commented Nov 7, 2023

The following code is expected to preserve the B,C,A order of original sequence but in reality produces A,B,C sequence of facets:

data = dict(
    cat = ["B", "C", "A"],
    c = ["blue", "cyan", "gray"]
)

p = (ggplot(data) 
     + geom_point(aes(color="c"), size=15) 
     + scale_color_identity() 
     + theme_void() + ggsize(400, 200)
     + facet_wrap("cat", ncol=3, order=0)
    )
p

image


When saving this plot to PNG, the picture is correct!

ggsave(p, "facet_ordering_issue.png")

image

Saving plot to svg or pdf also produces picture with correct B,C,A order of facets.
However, saving plot to html produces unexpected A,B,C ordering.

@alshan alshan added this to the 2023Q4 milestone Nov 7, 2023
@alshan alshan self-assigned this Nov 7, 2023
@alshan alshan closed this as completed in 868a23c Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant