title: Change x axis labels to character in ggplot
body: <p>I have produced a line plot with two lines, with x axis being the date. As shown in the picture below using the code here:</p>
  
  <p><a href="https://i.stack.imgur.com/mQNmF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mQNmF.png" alt="enter image description here"></a></p>
  
  <pre><code>
  date_col &lt;- paste0("2018-01-0", 1:9)
  
  col1 &lt;- runif(9)
  col2 &lt;- runif(9)
  
  df &lt;- as.data.frame( cbind(date_col, col1, col2) )
  df$date_col &lt;- as.Date(df$date_col)
  colnames(df) &lt;- c("Date" ,  "Col1", "Col2")
  
  
  
  df$Col1 &lt;- as.numeric(as.vector(df$Col1))
  df$Col2 &lt;- as.numeric(as.vector(df$Col2))
  
  axis_size = 10
  legend_size = 10
  title_size = 12
  line_size = 1
  caption_size=10
  
  meltdta &lt;- melt(df, id = "Date")
  
  
  plotobj &lt;- ggplot(meltdta, aes(x=Date, y=value, color=variable) )+
    geom_line(size=line_size)+ylab("Level") + theme_bw() + 
    ggtitle("trial") + 
    theme(axis.title=element_text(size=axis_size),
          legend.position = "bottom")
  
  
  print(plotobj)
  
  </code></pre>
  
  <p>I now want to change the date labels on the x axis to be Q0, Q1, Q2 ... to Q8. I wonder how I can do this? I have tried:</p>
  
  <pre><code>plotobj + scale_x_discrete(labels=paste0("Q", 0:8) )
  </code></pre>
  
  <p>before printing the object, but it doesn't seem to work.</p>
  
  <p>I have also tried added this line:</p>
  
  <pre><code>df[, "Date"] &lt;- paste0("Q", 0:8)
  </code></pre>
  
  <p>before the line</p>
  
  <pre><code>df$Col1 &lt;- as.numeric(as.vector(df$Col1))
  </code></pre>
  
  <p>but it produced an empty figure as shown below, the error: geom_path: Each group consists of only one observation. Do you need to adjust the group aesthetic? </p>
  
  <p><a href="https://i.stack.imgur.com/ZvNzK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZvNzK.png" alt="enter image description here"></a></p>