-
Notifications
You must be signed in to change notification settings - Fork 114
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
drop = FALSE does not work in scale_*_manual #164
Comments
This is just because df <- data.frame(x = 1:3, y = 1:3, z = factor(c("A", "B", "B")))
ggplot(df, aes(x, y, col = z)) +
geom_point() +
scale_color_manual(values = c("A" = "red", "B" = "blue", "C" = "black"), drop=FALSE) So you just need to tell it the levels. layout$Cat <- factor(layout$Cat, levels = c("A", "B", "C"))
ggraph(layout) +
geom_node_point(aes(color = Cat)) +
geom_edge_link() +
coord_fixed()+
theme_void()+
scale_color_manual(values = c("A" = "red", "B" = "blue", "C" = "black"), drop = FALSE) |
Hi! |
Same problem here but haven't found a solution yet. If anyone has a solution, please let me know. |
Its a change included in ggplot2 version 3.5.0 more info here Following the example here, you need to add
|
Hi,
Thank you very much for this package! However, I was puzzled to see that the option
drop = FALSE
was not passed along when provided through...
inscale_color_manual
for instance.Only the red and blue nodes are shown in the plot, which is expected. But the legend should mention the "C" category and the black label.
Do you have any ideas?
Best,
Charlie
The text was updated successfully, but these errors were encountered: