-
Notifications
You must be signed in to change notification settings - Fork 633
Redundant legend entries in facet_*() #378
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
Comments
A more minimal example of the same problem: library(plotly)
g <- ggplot(mtcars, aes(x = mpg, y = disp, color = factor(cyl))) + geom_point() + facet_wrap(~vs)
ggplotly(g) |
This should be fixed in f1900cc. Let us know if you still have problems. |
I have debugged this issue a bit. It appears when you specify a scale_color|fill_ value without declaring the relevant color|fill|etc in any aesthetics, the duplicate legends per facet appear. These work:
Both produce this: This doesn't work:
Code above takes out the fill in the aes mapping now, but keep the scale_fill_brewer() call. This is useless code as there is no fill aesthetic to work on, but it breaks the plotly legend. |
Currently, using facets for scatterplot matrix, combined with subgroup colors, produces a list of groups labels for each facet, making the graph un readable. Here is how it looks:
Instead of looking like this (in ggplot2):
Here is the code to reproduce:
The text was updated successfully, but these errors were encountered: