1
我有我從做了如下箱線圖:我想填充只有特定的顏色在箱線GGPLOT2
#Data
set.seed(395)
Env<- data.frame(CO2= c(cumsum(rnorm(1*36)), cumsum(rnorm(1*36))),
Group= rep(c("A","B"), each=36),
Segment=rep(seq(1,12),each=36))
ggplot(data=subset(Env, !is.na(Segment)),aes(factor(Segment),CO2))+
geom_boxplot()+
facet_wrap(~ Group)+
theme_bw()+
labs(x="Time segment", y="CO2")
上色3日,9日和12箱線圖的特定顏色:綠色,紅色和紫色。這可能嗎?
我嘗試沒有成功如下:
scale_fill_manual(values = c("", "","green","","","","","","red","","","purple"))
例如像這樣:
這是更難幫助繪製的問題,如果你不提供[重複的例子(http://stackoverflow.com/questions/5963269/how-to-make具有樣本輸入數據的可重複示例)。 – MrFlick