4
我有这样一个数据帧:如何更改ggplot2中的线条和形状颜色?
x <- data.frame(time = c('1', '2', '3'), perc = c(0.2, 0.4, 0.6, 0.3, 0.55, 0.69, 0.2, 0.22, 0.35), type=c(rep('a', 3), rep('b', 3), rep('c', 3)))
,并希望做这样的(下图)的阴谋,但使用这些不同的颜色c('#0023a0', '#f9a635', '#bebec0')
:
ggplot(x, aes(time, perc, group=type, colour=type, shape=type)) + geom_point(size=4) + geom_line(size=1)
我有已经尝试了使用scale_colour_hue
,scale_shape_discrete
和scale_fill_manual
的不同方法,但没有任何成功。
谢谢@Chase! – 2012-08-06 20:37:26