title: Incorrect Legend Ordering with scale_color_grey()
body: <p>I am doing a Monte Carlo simulation, in which I have to display the density of coefficient estimates for simulations with different sample sizes on the same plot. When using <code>scale_color_grey</code>. I have put my coefficient estimates in the same dataframe, with the sample size as a factor. If I query the factor with <code>levels()</code>, it is in the correct order (from smallest to highest sample size). However, the following code gives a scale in which the order is correct in the legend, but the color moves from light grey to darker grey in a seemingly random order</p>
  
  <pre><code>montecarlo &lt;- function(N, nsims, nsamp){
    set.seed(8675309)
    coef.mc &lt;- vector()
      for(i in 1:nsims){
        access &lt;- rnorm(N, 0, 1) 
        health &lt;- rnorm(N, 0, 1)
        doctorpop &lt;- (access*1) + rnorm(N, 0, 1)
        sick &lt;- (health*-0.4) + rnorm(N, 0, 1)
        insurance &lt;- (access*1) + (health*1) + rnorm(N, 0, 1)
        healthcare &lt;- (insurance*1) + (doctorpop*1) + (sick*1) + rnorm(N, 0, 1)
        data &lt;- as.data.frame(cbind(healthcare, insurance, sick, doctorpop))
        sample.data &lt;- data[sample(nrow(data), nsamp), ]
        model &lt;- lm(data=sample.data, healthcare ~ insurance + sick + doctorpop)
        coef.mc[i] &lt;- coef(model)["insurance"]
      }
    return(as.data.frame(cbind(coef.mc, nsamp)))
  }
  
  sample30.df &lt;- montecarlo(N=1000, nsims=1000, nsamp=30)
  sample100.df &lt;- montecarlo(1000,1000,100)
  sample200.df &lt;- montecarlo(1000, 1000, 200)
  sample500.df &lt;- montecarlo(1000, 1000, 500)
  sample1000.df &lt;- montecarlo(1000, 1000, 1000)
  montecarlo.df &lt;- rbind(sample30.df, sample100.df, sample200.df, sample500.df, sample1000.df)
  montecarlo.df$nsamp &lt;- as.factor(montecarlo.df$nsamp)
  levels(montecarlo.df$nsamp) &lt;- c("30", "100", "200", "500", "1000")
  
  ##creating the plot
  montecarlo.plot &lt;- ggplot(data=montecarlo.df, aes(x=coef.mc, color=nsamp))+
    geom_line(data = subset(montecarlo.df, nsamp==30), stat="density")+
    geom_line(data = subset(montecarlo.df, nsamp==100), stat="density")+
    geom_line(data = subset(montecarlo.df, nsamp==200), stat="density")+
    geom_line(data = subset(montecarlo.df, nsamp==500), stat="density")+
    geom_line(data = subset(montecarlo.df, nsamp==1000), stat="density")+
    scale_color_grey(breaks=c("30", "100","200", "500", "1000"))+
    labs(x=NULL, y="Density of Coefficient Estimate: Insurance", color="Sample Size")+
    theme_bw()
  montecarlo.plot 
  </code></pre>
  
  <p>Not using the <code>breaks</code> argument to <code>scale_color_grey</code> returns a legend in which the shades are in the right order, but which does not increase from smallest to highest sample size.</p>
  
  <p>What is going on here? As far as I understand it, <code>ggplot2</code> should follow the factor's order (which is correct) in assigning colors and creating the legend. How can I make both the legend and the shades of grey increase from smallest to lowest sample size?</p>