0

I am using the multiplot function in the coefplot package, which uses ggplot2 as a base. I am plotting multiple models but can't figure out how to change the color of each model. For example:

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

Any thoughts on this?

aosmith
  • 34,856
  • 9
  • 84
  • 118
coding_heart
  • 1,245
  • 3
  • 25
  • 46

1 Answers1

2

You can try to add scale_color

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

If it is ggplot base function, then try to use the ggplot settigns

Kuber
  • 1,023
  • 12
  • 21
Volodymyr
  • 888
  • 10
  • 21