title: matplotlib - what kind of set_major_locator should I use
body: <p>I have a question regarding a <code>plot</code> feature when the X-Axis is a date. </p>
  
  <p><strong>Setting</strong></p>
  
  <p>I have a two time-series <code>dt</code> and <code>x</code>, where <code>dt</code> is a list of <code>datetime.datetime</code> values and <code>x</code> is a <code>numpy</code> array object. </p>
  
  <pre><code>dt = 
  [datetime.datetime(1996, 12, 3, 0, 0), 
   datetime.datetime(1996, 12, 4, 0, 0), 
   ...,
   datetime.datetime(2015, 6, 5, 0, 0), 
   datetime.datetime(2015, 6, 8, 0, 0)]
  
  x = 
  array([29.06262, 29.26933, ..., 208.41999, 208.44532])
  </code></pre>
  
  <p>and both have the same length. </p>
  
  <p>When I plot them as :</p>
  
  <pre><code>ax.plot(dt, x, color='black', lw=2)
  </code></pre>
  
  <p>I get a chart which has X-Tick Labels as their years (e.g. <code>1994, 1998, 2002, 2006, 2010, 2014</code>). </p>
  
  <p>After some zooming, the X-Tick Labels nicely start showing months (e.g. <code>Aug 2009, Oct 2009, Dec 2009, Feb 2010, Apr 2010, Jun 2010</code>). </p>
  
  <p>After further zooming, the X-Tick Labels again nicely start showing days (e.g. <code>Jan 14 2010, Jan 21 2010, Jan 28 2010, Feb 04 2010, Feb 11 2010, Feb 18 2010</code>). </p>
  
  <p><strong>Question</strong></p>
  
  <p>Now, I am trying to draw a custom chart (e.g. say using <code>LineCollection</code>) instead of using the default <code>plot</code>. </p>
  
  <p>I suspect I would need to use <code>ax.xaxis.set_major_locator(???)</code> and <code>ax.xaxis.set_major_formatter(???)</code> to get the same feature of the X-Axis as in the default <code>plot</code> function.</p>
  
  <p>What do I need to provide (i.e. <code>???</code>) to <code>ax.xaxis.set_major_locator(???)</code> and <code>ax.xaxis.set_major_formatter(???)</code> ?</p>