title: multiple lines each based on a different dataframe in ggplot2 - automatic coloring and legend
body: <p>Suppose I have the following data frames:</p>
  
  <pre><code>df1 = data.frame(c11 = c(1:5), c12 = c(1:5))
  df2 = data.frame(c21 = c(1:5), c22 = (c(1:5))^0.5)
  df3 = data.frame(c31 = c(1:5), c32 = (c(1:5))^2)
  </code></pre>
  
  <p>I want to plot these as lines in the same plot/panel. I can do this by</p>
  
  <pre><code>p &lt;- ggplot() + geom_line(data=df1, aes(x=c11, y = c12)) + 
       geom_line(data=df2, aes(x=c21,y=c22)) + 
       geom_line(data=df3, aes(x=c31, c32))
  </code></pre>
  
  <p>All these will be black. If I want them in a different color, I can specify the color explicitly as an argument to <code>geom_line()</code>. My question is can I specify a list of a few colors, say 5 colors, such as, red, blue, green, orange, gray, and use that list so that I do not have to explicitly specify the colors as an argument to geom_line() in case of each line. If the plot <code>p</code> contains 2 geom_line() statements then it will color them red and blue respectively. If it contains 3 geom_line statements, it will color them red, blue and green. Finally, how can I specify the legend for these plots. Even if I can give the colors as a vector at the end of <code>p</code> that would be great. Please let me know if the question is not clear.</p>
  
  <p>Thanks.  </p>