title: setting color of line in ggplot2
body: <p>I have a weather data set which measure temperatures inside a house and outside. I am trying to set the colors of the lines plotted and reflect those in a legend which indicates which color represents the inside and outside using ggplot2. I have not been able to set the colors as &quot;red&quot; and &quot;blue&quot; as appropriate. How can I achieve that. Below is some artificially generated data plus code.</p>
  <pre><code>datime &lt;- seq(as.POSIXct(&quot;2021-01-01&quot;), as.POSIXct(&quot;2021-01-31&quot;), by=&quot;d&quot;)
  set.seed(5)
  tmpout &lt;- round(runif(31, 20, 35), 1)
  tmpin &lt;- tmpout + round(runif(31, -6, -5), 1)
  temps &lt;- data.frame(datime, tmpout, tmpin)
  
  theme_set(theme_bw())
  
  xlabel &lt;- &quot;Time&quot;
  ylabel &lt;- expression(paste(&quot;Temperature (&quot;, ~degree~C, &quot;)&quot;, sep=&quot;&quot;))
  
  g1 &lt;- ggplot(aes(x=datime, y=tmpout), data=temps) + geom_line(aes(colour=&quot;blue&quot;), size=1) + geom_line(aes(y=tmpin, colour=&quot;red&quot;), size=1) + scale_colour_manual(values=c(inside=&quot;red&quot;, outside=&quot;blue&quot;)) + scale_color_discrete(name=&quot;Location&quot;, labels=c(&quot;Outside&quot;, &quot;Inside&quot;))
  g2 &lt;- scale_x_datetime(date_breaks=&quot;1 weeks&quot;, date_labels=&quot;%d %b %Y&quot;)
  g3 &lt;- g1 + g2 + labs(title=&quot;Indoor &amp; Outdoor Temperatures\n800 Mindarie Road Pyap West SA 5333&quot;, x=&quot;Dates&quot;, y=ylabel) 
  l1 &lt;- theme(legend.position=c(0.05,0.9), legend.key.width=unit(3, &quot;line&quot;), legend.text=element_text(size=14, face=&quot;bold&quot;), legend.title=element_text(size=16, face=&quot;bold&quot;), legend.title.align=0.5, legend.text.align=0.5, legend.spacing = unit(1, &quot;cm&quot;)) 
  g3 + l1 + theme(axis.text.x=element_text(size=rel(1.4)), axis.title.x=element_text(size=20), axis.text.y=element_text(size=rel(1.4)), axis.title.y=element_text(size=20), plot.title=element_text(size=15, hjust=0.5))
  </code></pre>