2015-10-20 72 views
0

我在coefplot包中使用multiplot函數,該函數使用ggplot2作爲基準。我正在繪製多個模型,但無法弄清楚如何更改每個模型的顏色。例如:更改多色模型中的模型顏色(ggplot2)

require(coefplot) 
data(diamonds) 
model1 <- lm(price ~ carat + cut, data=diamonds) 
model2 <- lm(price ~ carat + cut + color, data=diamonds) 
multiplot(model1, model2) 
# multiplot(model1, model2, colors = c("blue", "red")) # Doesn't Work 

對此有何看法?

回答

2

你可以嘗試添加scale_color

multiplot(model1, model2)+scale_color_manual(values=c("red","blue")) 

如果ggplot基函數,然後嘗試使用ggplot settigns