title: Change number of x ticks on time series using ggplot2
body: <p>I'm trying to plot a time series <code>x_output</code> that looks like this:</p>
  
  <pre><code>              timestamp   city wait_time weekday     time
      2015-07-14 09:00:00 Boston       1.6 Tuesday 09:00:00
      2015-07-14 09:01:00 Boston       1.8 Tuesday 09:00:00
      2015-07-14 09:02:00 Boston       2.4 Tuesday 09:00:00
      2015-07-14 09:03:00 Boston       2.9 Tuesday 09:00:00
      2015-07-14 09:04:00 Boston       4.5 Tuesday 09:00:00
      2015-07-14 09:05:00 Boston       5.6 Tuesday 09:00:00
  </code></pre>
  
  <p>Here's how I'm plotting it:</p>
  
  <pre><code>brks &lt;- seq(1, length(x_output$timestamp), 10)
  brks_labels &lt;- x_output[brks, ]
  
  p &lt;- ggplot(x_output, aes(x=as.character(timestamp), y=wait_time, group=city)) + geom_line(aes(color=city), size=1.5) + theme(axis.text.x = element_text(angle = 90, hjust=1), legend.position = "bottom") + labs(x=NULL, y="Waiting time (minutes)") + scale_x_discrete(breaks = brks, labels = brks_labels)
  print(p)
  </code></pre>
  
  <p>I have to use <code>x_output$timestamp</code> as a character (ie. categorical variable) because otherwise, ggplot2 thinks it's continuous and includes white blank areas that have no values. </p>
  
  <p>For some reason however, <code>scale_x_discrete</code> does not seem to be working. I believe I got the input for breaks right, however, the labels now aren't showing. Does anyone know why? Here's what plots:</p>
  
  <p><img src="https://i.stack.imgur.com/gBZqf.png" alt="enter image description here"></p>
  
  <p>I'm trying to simply have the labels appear every 10 timestamps on the x-axis (which is why I put the breaks into an array as <code>brks</code>).</p>