title: How can I reorder the legend in ggplot2 having scale_colour_manual and scale_linetype_manual together?
body: <p>I need to change the order in the ggplot legend. A simple plot for this purpose is copied below. How can I have 'Forecaster_2' appear before 'Forecaster_1'? I have tried breaks but could not make it work.</p>
  
  <pre><code>library(ggplot2)
  
  x_1 &lt;- rep(0:6, each = 2)
  pdf_1 &lt;- c(0,0.05,0.05,0.1,0.1,0.15,0.15,0.3,0.3,0.25,0.25,0.15,0.15,0)
  
  x_2 &lt;- rep(3:9, each = 2)
  pdf_2 &lt;- c(0,0.05,0.05,0.1,0.1,0.15,0.15,0.3,0.3,0.25,0.25,0.15,0.15,0)
  
  data_1 &lt;- data.frame(x_1, pdf_1,x_2,pdf_2)
  
  ggplot()+
    geom_line(data=data_1,aes(x=x_1, y=pdf_1, color="Forecaster_1", linetype='Forecaster_1'),size=1)+
    geom_line(data=data_1,aes(x=x_2, y=pdf_2, color="Forecaster_2", linetype='Forecaster_2'),size=1)+
    labs(x = "x") +
    labs(y = "PDF") +
    scale_colour_manual("Line", values = c('Forecaster_1' = 'cornflowerblue', 'Forecaster_2' = 'coral2')) +
    scale_linetype_manual("Line", values = c('Forecaster_1' = 'solid', 'Forecaster_2' = 'dashed'))+
    theme(legend.position="top",
          legend.title=element_blank())
  </code></pre>