Skip to content

Categorical ggplotly legend no longer interpreted as categorical when two aesthetics are used #2354

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

Closed
LukasWallrich opened this issue May 22, 2024 · 1 comment

Comments

@LukasWallrich
Copy link

When showing a legend for categorical data, ggplotly works fine when only one aesthetic is used - but switches to show intervals rather than categories as soon as two different aesthetics are used.


Looking good:

p <- ggplot(mtcars, aes(wt, mpg)) + geom_boxplot(aes(col = factor(am))) + geom_rug(aes(col = factor(am)))
ggplotly(p)

image

Not looking good (just concerned about the legend, also fails where fill aesthetic works):

p <- ggplot(mtcars, aes(wt, mpg)) + geom_boxplot(aes(fill = factor(am))) + geom_rug(aes(col = factor(am)))
ggplotly(p)

image

@LukasWallrich
Copy link
Author

Misunderstood what is shown, sorry - duplicates #1164

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