title: geom_line groups and scale_color_manual Produce Unexpected Error
body: <p>Oddly enough, I can't find anything online to solve this problem I'm having. </p>
  
  <p>Generating data:</p>
  
  <pre><code>rm(list = ls())
  library(ggplot2)
  X &lt;- as.numeric(1:100)
  df &lt;- data.frame(x=X,y=rnorm(n=100,sd=.1)+sin(X*pi/200),gp=1)
  for (i in 2:4) df &lt;- rbind(df,data.frame(x=X,y=rnorm(n = 100,sd = .1)+sin(X*i*pi/200),gp=i))
  </code></pre>
  
  <p>The head of this data frame looks like:</p>
  
  <pre><code>  x            y gp
  1 1  0.030678982  1
  2 2  0.108093934  1
  3 3  0.067512201  1
  4 4  0.186648638  1
  5 5  0.109397764  1
  6 6 -0.005158247  1
  </code></pre>
  
  <p>Sanity check:</p>
  
  <pre><code>&gt; unique(df$gp)
  [1] 1 2 3 4
  </code></pre>
  
  <p>Now, all I want to do is plot these 4 lines with various <em>contrasting</em> colors; i.e., I do not want the following:</p>
  
  <pre><code>&gt; p &lt;- ggplot(data = df,aes(x=x,y=y,group=gp,color=gp))+geom_line()+theme_bw()
  &gt; p
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/6nIus.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6nIus.png" alt="Bad Contrast Between Lines"></a></p>
  
  <p>In the above plot, the legend is horrendous and the lines have horrible contrast. Why is this so hard? So I tried the following:</p>
  
  <pre><code>&gt; p &lt;- ggplot(data = df,aes(x=x,y=y,group=gp,color=gp))+geom_line()+theme_bw()+scale_color_manual(values = c('red','blue','green','black'))
  &gt; p
  </code></pre>
  
  <p>which yields:</p>
  
  <pre><code>Error: Continuous value supplied to discrete scale
  </code></pre>
  
  <p>How can I tell ggplot to just give me a wide variety of colors and apply them to every line (labeled by <code>group=gp</code>)?</p>