Question: I am using geom\_smooth and it gives me default legend line color blue that I cannot use in the plot. Is there a way of changing the default color for geom\_smooth legend line?

for example, I wand to change the legend colour to black for line type in the following plot

```
      library(reshape2)
    library(ggplot2)
d1<-melt(mtcars,id=c("mpg","cyl"))
        p<-ggplot(d1,aes(x=mpg,y=value,factor=variable,color=cyl))
        p1<-p+geom_smooth(aes(linetype = as.factor(cyl)),se = F,stat = "smooth",method = "glm",size=.5,  inherit.aes = T)+
          scale_linetype_manual("line type",labels = rp, values=c(1,5,4,3))

```

[![enter image description here](https://i.stack.imgur.com/84k2E.png)](https://i.stack.imgur.com/84k2E.png)

Answer: 
Per my comment, if you add an override to your legend you can change how the color displays. This should work:

```
p1<-p+geom_smooth(aes(linetype = as.factor(cyl)),se = F,stat = "smooth",method = "glm",size=.5,  inherit.aes = T)+
  scale_linetype_manual("line type",labels = c("100 yr", "50 yr", "25 yr"), values=c(1,5,4,3)) + 
  guides(linetype = guide_legend(override.aes= list(color = "black")))

```

And the resulting plot is:

[![enter image description here](https://i.stack.imgur.com/023d7.png)](https://i.stack.imgur.com/023d7.png)
if you add `+ guides(linetype = guide_legend(override.aes= list(color = "black")))` to your last plot do

This solves thanks @Mike