title: Setting specific date timestaps as xticks in Matplotlib
body: <p>I'm trying to plot price data with dates ax the <code>xticks</code>. I've taken a look at <a href="https://stackoverflow.com/questions/12608788/changing-the-tick-frequency-on-x-or-y-axis-in-matplotlib">this answer - "Changing the Tick Prequency"</a> and <a href="https://stackoverflow.com/questions/18194136/showing-specific-xtick-in-matplotlib">this answer - "showing specific xtick on Matplotlib"</a> but my problem seems to persist. Allow me to elaborate:</p>
  
  <p>The data that I have looks something like this:</p>
  
  <pre><code>date             Close
  2017-05-10      0.12512
  2017-05-11      0.12353
  2017-05-12     -0.35235
  .
  .
  .
  2019-01-10      0.87890
  </code></pre>
  
  <p>It's a total of 608 entries, and the closing prices have all been scaled to be within (-1, 1).</p>
  
  <p>The code that I wrote to make the plot is:</p>
  
  <pre><code>plt.plot(train['Close'], label='Training Data')
  plt.Figure()
  plt.plot(test['Close'], label='Test Data')
  plt.grid(True)
  plt.title("Closing Prices")
  plt.ylabel('Price Scaled')
  plt.xlabel('Time')
  plt.legend()
  plt.show()
  </code></pre>
  
  <p>which produces this image:</p>
  
  <p><a href="https://i.stack.imgur.com/xv83I.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xv83I.png" alt="enter image description here"></a></p>
  
  <p>As you can see, the <code>xtick</code> intervals are 100 in size and the graph starts at 0 and ends at 608. My question is: how do I format the graph so that the starting date (<code>2017-05-10</code>) is at 0, and the <code>xtick</code> prints only for each 100th tick? Also, I'm trying to get the 608th tick to show its date as well.</p>