我正在使用以下代码制作一个图形:
d1 <- data.frame(time = c(0,15,60,120),
number = c(0, 5, 5, 10, 0, 20, 20, 25),
arm = c(rep("A",4), rep("B",4)))
ggplot(d1, aes(x = time, y = number, color = arm)) +
scale_color_grey(start = 0.6, end = 0.2, guide = F) +
geom_point(aes(shape = arm),
size = 3,
position = position_dodge(width=0)) +
geom_line(aes(),
position = position_dodge(width=0)) +
scale_x_continuous(name = "Time",breaks=c(0,15,60,120)) +
scale_shape_discrete(name = " ",
labels = c("A type","B type")) +
theme(axis.title.x=element_text(size=9),
legend.position = "top",
panel.grid.major = element_blank(),
panel.grid.minor = element_blank()) +
ylab("People")
但是,我注意到 A 型的点颜色不是灰色,而是黑色。
无论如何,我可以相应地手动更改它吗?
如果可能的话,我想保留函数“scale_color_grey”。
谢谢!!