可能重複:
How to change line and shape colours in ggplot2?ggplot多條曲線中選擇自己的顏色
pdf('test',onefile=T)
g <- ggplot(test,aes(x=timepoints,y= mean,ymax = mean + sde, ymin = mean - sde,colour=Experiment)) +
geom_errorbar(width=2) +
geom_point() +
geom_line() +
xlab('Time (min)') +
ylab('Fold Induction') +
opts(title = '5 min v 6 hr KCl treatment')
print(g)
dev.off()
這是它打印。
我如何改變顏色從默認假設紅色和黑色的?所以'5分鐘'是紅色'6小時'是黑色?
複製? http://stackoverflow.com/q/11835451/1317221 –