2015-10-20 55 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