我正试图在我的折线图中添加更多的线条.如何确保所有新添加的行都呈灰色显示?
first4letters <- c(rep("A", 3), rep("B", 3), rep("C", 3), rep("D", 3))
times <- rep(c("time1", "time2", "time3"), 4)
score <- c(5, 10, 2, 3, 4, 7, 11, 2, 9, 4, 6, 11)
df <- data.frame(first4letters, times, score)
df
plot1 <- ggplot(data = df, aes(times, score, group = first4letters)) +
geom_line(aes(color = first4letters)) +
geom_point(aes(color = factor(first4letters)), size = 1) +
theme_classic()
plot1 + scale_color_manual(values = c("red", "blue", "black", "orange"))
我会添加一些新的字母.但是,显示这些字母的线条必须是灰色的.我不能向scale_color_manual()函数添加新值.因为该函数本身决定了 colored颜色 的顺序.