title: R ggplot changing the color and legend sequences in legend
body: <p>the data in this post: <a href="https://stackoverflow.com/questions/51648204/joining-all-points-inside-a-grouped-point-plot-using-ggplot">joining all points inside a grouped point plot using ggplot</a>  remains same I have added one more column  to it. By taking help of given solution by Jimbou I wrote following code</p>
  
  <pre><code>head(AA)
   States Clusters   value Comp_apply L1_25 L1_30 L1_50     x xbreaks
  &lt;chr&gt;  &lt;chr&gt;      &lt;dbl&gt;      &lt;int&gt; &lt;int&gt; &lt;int&gt; &lt;int&gt; &lt;dbl&gt;   &lt;dbl&gt;
  1 HR     Cluster-1 0.0703          9     2     4     7    31    32.7
  2 HR     Cluster-2 0.0761          4     2     2     3    33    32.7
  3 HR     Cluster-3 0.0692          9     7     7     8    34    32.7
  4 WB     Cluster-1 0.0372         13     2     2     2   111   113. 
  5 WB     Cluster-2 0.0762         13     2     3     6   113   113. 
  6 WB     Cluster-3 0.0906         13     3     3     4   114   113. 
  </code></pre>
  
  <p>now the code for plotting is</p>
  
  <pre><code>ggplot(data=data.m1)+
   geom_line(aes(x = x, y = Comp_apply, group=States,color="red")
             ,position=position_dodge(width = 0.90))+
    geom_point(aes(x = x, y = Comp_apply, group=States,color="red")
          ,position=position_dodge(width = 0.90))+
    geom_line(aes(x = x, y = L1_25, group=States,color="green")
          ,position=position_dodge(width = 0.90))+
    geom_point(aes(x = x, y = L1_25, group=States,color="green")
           ,position=position_dodge(width = 0.90))
  </code></pre>
  
  <p>Now the plot looks as follows
  <a href="https://i.stack.imgur.com/EUFjP.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EUFjP.jpg" alt="enter image description here"></a></p>
  
  <p>can you help me how to rectify this</p>