-
Notifications
You must be signed in to change notification settings - Fork 2.1k
scale_color_manual and scale_linetype_manual did not work in the dev version 3.3.3.9000 #4479
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 reprex: library(ggplot2)
packageVersion("ggplot2")
#> [1] '3.3.3.9000'
groups <- LETTERS[1:3]
df <- data.frame(
x = rep(1:10, 3),
y = rnorm(30),
group = rep(groups, each = 10)
)
ggplot(df, aes(x, y, colour = group, linetype = group)) +
geom_line() +
scale_colour_manual(
"",
values = setNames(c("blue", "green", "red"), groups)
) +
scale_linetype_manual(
"",
values = setNames(c("solid", "dashed", "dotted"), groups)
) The problem appears to be related to how the first unnamed argument is passed around. If you explicitly set ggplot(df, aes(x, y, colour = group, linetype = group)) +
geom_line() +
scale_colour_manual(
name = "",
values = setNames(c("blue", "green", "red"), groups)
) +
scale_linetype_manual(
name = "",
values = setNames(c("solid", "dashed", "dotted"), groups)
) Created on 2021-05-16 by the reprex package (v1.0.0) |
Thanks, confirmed. Now the first unnamed argument is absorbed by @thomasp85 |
Fixed in the release candidate |
@thomasp85 https://github.com/tidyverse/ggplot2/commits/v3.3.4-rc |
forgot to push - it should be there now |
Confirmed, thanks! 7022d31 |
Thank you all for the help! |
Brief description of the problem
Adding
scale_color_manual
andscale_linetype_manual
makes all the lines disappeared. This was not a problem with the CRAN version 3.3.3.Please let me know if I missed anything obvious. Thanks!
Set colors and line types manually
Plot
Adding manual color scale
Adding both manual color and linetype scales
Here is the plot result generated using CRAN v3.3.3
Created on 2021-05-16 by the reprex package (v2.0.0)
Session info
The text was updated successfully, but these errors were encountered: